Welcome!
Important information
-- Spectre and Meltdown vulnerabilities
-- Change in MX sources

News
-- MX Linux on social media: here
-- Mepis support still here

Current releases
-- MX-17.1 Final release info here
-- antiX-17 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

PDF --> JPG --> PDF

This forum is intended for the discussion around the use of MEPIS in an office setting as distinct from home or indivicual usage. Examples include mail merge, database construction, hardware sharing, advertising, etc..
Message
Author
User avatar
joany
Forum Veteran
Forum Veteran
Posts: 5919
Joined: Mon Feb 12, 2007 1:45 pm

PDF --> JPG --> PDF

#1 Post by joany » Mon Jul 28, 2014 10:04 am

I have a need to convert multi-page PDF files to JPG files and JPG files to multi-page PDFs. Are there any applications that do this?
MX-14; 3.12-0.bpo.1-686-pae kernel using 4GB RAM
2.4GHz AMD Athlon 4600+
NVidia GeForce 6150 LE; 304.121 Display Driver
You didn't slow down because you're old; you're old because you slowed down.

User avatar
Stevo
Forum Veteran
Forum Veteran
Posts: 16310
Joined: Fri Dec 15, 2006 8:07 pm

Re: PDF --> JPG --> PDF

#2 Post by Stevo » Mon Jul 28, 2014 10:15 am

Do the final PDF files have to be editable text, or just bitmaps?

User avatar
joany
Forum Veteran
Forum Veteran
Posts: 5919
Joined: Mon Feb 12, 2007 1:45 pm

Re: PDF --> JPG --> PDF

#3 Post by joany » Mon Jul 28, 2014 10:44 am

Stevo wrote:Do the final PDF files have to be editable text, or just bitmaps?
No editable text. In fact, that's what I'm shooting for. I upload PDF files to a file-sharing service (for read-only) but the formats get messed up; e.g., superscripts and subscripts, underlines, etc. If I upload a PDF of an image, these format changes won't occur.
MX-14; 3.12-0.bpo.1-686-pae kernel using 4GB RAM
2.4GHz AMD Athlon 4600+
NVidia GeForce 6150 LE; 304.121 Display Driver
You didn't slow down because you're old; you're old because you slowed down.

User avatar
richb
Administrator
Posts: 17104
Joined: Wed Jul 12, 2006 2:17 pm

Re: PDF --> JPG --> PDF

#4 Post by richb » Mon Jul 28, 2014 10:48 am

You can open a pdf in GIMP and import. Then save as a jpg. You can also export a jpg as a PDF.
Forum Rules
Guide - How to Ask for Help

Rich
SSD Production: MX 17.1
AMD A8 7600 FM2+ CPU R7 Graphics, 16 GIG Mem. Three Samsung EVO SSD's 250 GB, 350 GB HD

User avatar
joany
Forum Veteran
Forum Veteran
Posts: 5919
Joined: Mon Feb 12, 2007 1:45 pm

Re: PDF --> JPG --> PDF

#5 Post by joany » Mon Jul 28, 2014 12:10 pm

richb wrote:You can open a pdf in GIMP and import. Then save as a jpg. You can also export a jpg as a PDF.
Thanks! I now do remember another thread on a similar topic. Does Gimp handle multiple pages or just one at a time?
MX-14; 3.12-0.bpo.1-686-pae kernel using 4GB RAM
2.4GHz AMD Athlon 4600+
NVidia GeForce 6150 LE; 304.121 Display Driver
You didn't slow down because you're old; you're old because you slowed down.

User avatar
richb
Administrator
Posts: 17104
Joined: Wed Jul 12, 2006 2:17 pm

Re: PDF --> JPG --> PDF

#6 Post by richb » Mon Jul 28, 2014 12:51 pm

There is an option to import as images, the default is layers. You would then need to export each one as a JPG. It is time consuming for pdfs with many pages.
Forum Rules
Guide - How to Ask for Help

Rich
SSD Production: MX 17.1
AMD A8 7600 FM2+ CPU R7 Graphics, 16 GIG Mem. Three Samsung EVO SSD's 250 GB, 350 GB HD

User avatar
joany
Forum Veteran
Forum Veteran
Posts: 5919
Joined: Mon Feb 12, 2007 1:45 pm

Re: PDF --> JPG --> PDF

#7 Post by joany » Mon Jul 28, 2014 1:13 pm

richb wrote:There is an option to import as images, the default is layers. You would then need to export each one as a JPG. It is time consuming for pdfs with many pages.
Yes, I see what you mean. I can export one layer at a time as individual PDFs and combine them using pdfshuffler, but that is very time-consuming.

I tried using the terminal command "convert infile.pdf outfile.jpg" and it creates one image file per page named outfile-0.jpg, outfile-1.jpg, etc.; however, the output image quality is extremely poor.

I'll keep looking. There are free on-line services that do the required conversions, and the quality isn't bad, but I'd like to do the converting on my computer if possible.
MX-14; 3.12-0.bpo.1-686-pae kernel using 4GB RAM
2.4GHz AMD Athlon 4600+
NVidia GeForce 6150 LE; 304.121 Display Driver
You didn't slow down because you're old; you're old because you slowed down.

User avatar
richb
Administrator
Posts: 17104
Joined: Wed Jul 12, 2006 2:17 pm

Re: PDF --> JPG --> PDF

#8 Post by richb » Mon Jul 28, 2014 1:26 pm

I also tried LibreOffice Writer. The same applies as to exporting one at a time. Hopefully there is a customized app for this.

I did find this

http://xmodulo.com/2012/11/convert-pdf- ... linux.html
Forum Rules
Guide - How to Ask for Help

Rich
SSD Production: MX 17.1
AMD A8 7600 FM2+ CPU R7 Graphics, 16 GIG Mem. Three Samsung EVO SSD's 250 GB, 350 GB HD

User avatar
joany
Forum Veteran
Forum Veteran
Posts: 5919
Joined: Mon Feb 12, 2007 1:45 pm

Re: PDF --> JPG --> PDF

#9 Post by joany » Mon Jul 28, 2014 4:30 pm

richb wrote:I also tried LibreOffice Writer. The same applies as to exporting one at a time. Hopefully there is a customized app for this.

I did find this

http://xmodulo.com/2012/11/convert-pdf- ... linux.html
Reading over the instructions, I saw that the convert command has a couple of options that definitely improves the quality. Using the "-density 500" option shown does that, but the resulting .jpg page files are very large.

Fortunately, going the other way (multiple .jpg files to multi-page .pdf file) works well. The "convert -help" lists a host of other options. I think I can make this work with a little effort. Thanks!
MX-14; 3.12-0.bpo.1-686-pae kernel using 4GB RAM
2.4GHz AMD Athlon 4600+
NVidia GeForce 6150 LE; 304.121 Display Driver
You didn't slow down because you're old; you're old because you slowed down.

User avatar
Stevo
Forum Veteran
Forum Veteran
Posts: 16310
Joined: Fri Dec 15, 2006 8:07 pm

Re: PDF --> JPG --> PDF

#10 Post by Stevo » Mon Jul 28, 2014 4:54 pm

It looks like you add flags to the "convert" command line to improve the quality.

Try "convert -density 400 input.pdf output.jpg"

Decrease density to lower quality and file size. You get numbered jpgs corresponding to each page. Then convert to a single pdf with

Code: Select all

convert *.jpg output.pdf
You should be able to join the two commands with "&&". Using png files instead of jpg may go faster, too. And then add "&& rm *.jpg (or png)" to the end of the command to clean the temp files up.

Edit: png files don't seem to work...

This one converts the first seven pages of "a.pdf":

Code: Select all

convert -density 400 a.pdf[0,1,2,3,4,5,6] output.jpg && convert *.jpg output.pdf && rm *.jpg

Post Reply

Return to “Office”