Score:1

Combine a .jpg and .txt in one PDF file (A4 format)

ro flag

I'm trying to combine two separate files into one PDF file (A4 format). The left side should be filled with a jpeg image (for example: 0050.jpg) and the right side should be filled with text (or an image of the text file) for example 0050.txt

I'm aware of ImageMagick and the possibility to convert files, however I don't know how to combine two different file types into one A4 format PDF, meaning that each file gets the same amount of space, one on the left side, the other on the right side.

As I need to create more than 200 PDFs' ultimately, any line of code that could be applied in such a way that it processes all corresponding files in the same directory in one go, would be appreciated.

Thanks.

cn flag
Ray
It's a bit of a steep learning curve if you don't know it, but if there is no other alternative from anyone else and you have 200 to do, you could consider learning LaTeX...
hr flag
... some popular methods with (pdf)latex seem to be either using side-by-side minipages or the sidecap package - see for example [Caption on the side of a figure](https://tex.stackexchange.com/questions/29143/caption-on-the-side-of-a-figure)
hr flag
Another option might be to print the text(s) to pdf, then use pdftk to interleave them with the images, followed by pdfnup to arrange adjacent pages side-by-side on a single page
zx485 avatar
us flag
An alternative I suggest is using XSL-FO. With this, you can use XSLT to transform your text file with the JPEG file into a PDF file. But this approach is quite demanding, too.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.