Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8936113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:08:42+00:00 2026-06-15T10:08:42+00:00

I am using pdftk like this pdftk template.pdf fill_form /temp/input.fdf output /temp/output.pdf Now this

  • 0

I am using pdftk like this

pdftk template.pdf fill_form /temp/input.fdf output /temp/output.pdf

Now this is working fine

But now i have generated the temporary file instead of /temp/input.fdf with this

myfile = tempfile.NamedTemporaryFile()
myfile.write(fdf)
myfile.seek(0)
myfile.close()

Now i don’t know how can i pass myfile as input to the pdftk

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:08:43+00:00Added an answer on June 15, 2026 at 10:08 am

    myfile.name will get you the file path.

    Note that tempfiles do not exist after close(). From the docs:

     tempfile.TemporaryFile([mode='w+b'[, bufsize=-1[, suffix=''[, 
        prefix='tmp'[, dir=None]]]]])
    

    Return a file-like object that can be used as a temporary storage
    area. The file is created using mkstemp(). It will be destroyed as
    soon as it is closed (including an implicit close when the object is
    garbage collected). Under Unix, the directory entry for the file is
    removed immediately after the file is created. Other platforms do not
    support this; your code should not rely on a temporary file created
    using this function having or not having a visible name in the file
    system.

    Source: http://docs.python.org/2/library/tempfile.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using pdftk for flattening PDF files on server. For this purpose I use
Using Rails 3, but I guess doesn't matter. I put this in the template
I'm using php with PDFTK on Ubuntu. When filling a PDF with data, I
I am using Dompdf to generate A5 pdf documents from a html template and
Using pdftk I generate some dynamic temporary pdf files, which then Django serves to
I use pdftk to compress a pdf using the following command line pdftk file1.pdf
I'm using pdftk to fill in a PDF form with an XFDF file. However,
I'm using pdftk and doing some testing and finding that bursting a multipage PDF
i am using PHP to run exec() on a script which looks like this:
I'm using pdftk to concatenate pdf files on the fly by making an exec()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.