Results 1 to 4 of 4

Thread: Can you place a .txt file onto a pdf from the command line?

  1. #1
    Join Date
    Jul 2021
    Beans
    6

    Can you place a .txt file onto a pdf from the command line?

    Hi there, using Ubuntu 18.04.

    I have a .txt file with about 85 words on it that I would like to overlay on to a pdf. The pdf has boxes and borders and lines, and I am looking for a way to place the contents of the .txt file onto the pdf, resulting in a new pdf.

    Can something like that be done from the command line?

    Thanks~

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Can you place a .txt file onto a pdf from the command line?

    Perhaps pdfattach will work? It is part of the poppler-utils package.

    OR use pandoc to make PDF from many other formats.
    Code:
    $ pandoc test.txt -o test.pdf
    And use pdfunite to place the new PDF into the old one, creating a new PDF as the result.
    Code:
    $ pdfunite sample1.pdf sample2.pdf sample.pdf
    I don't know how to batch place an annotation onto a specific page, into a specific location. Well, not without custom programming.
    You might have a completely different purpose.

  3. #3
    Join Date
    Apr 2007
    Beans
    2,945
    Distro
    Ubuntu

    Re: Can you place a .txt file onto a pdf from the command line?

    pdfunite will append files in one PDF, but not superimpose one page on another. qpdf has an --overlay option, whereas pdftk has the "stamp" or "multistamp" options to overlay.

  4. #4
    Join Date
    Jul 2021
    Beans
    6

    Re: Can you place a .txt file onto a pdf from the command line?

    Thanks for the suggestions! Will give them a try.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •