Announcing PeasyP2J

Word processors, spreadsheets, presentations, translation, etc.
Message
Author
User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

Announcing PeasyP2J

#1 Post by rcrsn51 »

Update: PeasyP2J has now been incorporated into PeasyPDF.
Last edited by rcrsn51 on Wed 30 May 2012, 05:49, edited 15 times in total.

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#2 Post by jpeps »

Exprimo is using ghostscript 8.71. Current version is 9.05.


command line way (for whole doc, leave out FirstPage/LastPage):

Code: Select all

gs -dNOPAUSE -sDEVICE=jpeg -r144 -dFirstPage=12 -dLastPage=12 -sOutputFile=p%03d.jpg file.pdf
Last edited by jpeps on Sat 26 May 2012, 02:26, edited 1 time in total.

User avatar
davids45
Posts: 1326
Joined: Sun 26 Nov 2006, 23:33
Location: Chatswood, NSW

#3 Post by davids45 »

G'day rcrsn51,

A nice utility.

Using Slacko-5.3.3 as-was, converted OK a pdf made by CUPS-PDF and pages from a printer manual taken off the manufacturer's CD-ROM.
But then had a failure to get jpgs from a downloaded pdf manual for an espresso coffee machine.
So I downloaded the new ghostscript version you provided the link to, installed this into Slacko-5.3.3, and PeasyP2J now works with this pdf as well.

Changing the dpi and re-doing the same page gave no warning about over-writing the original jpg file, but as it all works so quickly, such a warning is probably unnecessary - just do it again until I'm happy with the image, or manually rename the previous file if I need to keep it as well.

Thanks for the pet,

David S.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#4 Post by rcrsn51 »

davids45 wrote:So I downloaded the new ghostscript version you provided the link to, installed this into Slacko-5.3.3, and PeasyP2J now works with this pdf as well.
Thanks for testing this.

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#5 Post by vovchik »

Dear puppians,

Here is a variation that produces png files and can handle transparency. If rcrsn51 wants to add it to his little gem of a program, fine, otherwise it also works standalone.

With kind regards,
vovchik
Attachments
peasyp2p.tar.gz
(1008 Bytes) Downloaded 606 times

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#6 Post by rcrsn51 »

vovchik wrote:Here is a variation that produces png files and can handle transparency.
Excellent! I have packaged your PNG features as a separate PET based on my cleaned-up version 1.2. Could you give it some tests? The transparency option appears to be working.
Attachments
peasyp2p-1.2.pet
(1.35 KiB) Downloaded 612 times
Last edited by rcrsn51 on Sun 27 May 2012, 01:38, edited 3 times in total.

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#7 Post by jpeps »

Why limit it to one page? It would be trivial to let it include any or no limiter (eg, 4-7) for page selection.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#8 Post by rcrsn51 »

jpeps wrote:Why limit it to one page? It would be trivial to let it include any or no limiter (eg, 4-7) for page selection.
While that feature is certainly possible, I can't see the practical value. I believe that people would use this program to extract a single interesting image from a PDF document. I can't envision a scenario where I would want to turn an entire PDF into single JPEGs.

See the discussion here.

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#9 Post by jpeps »

I suppose something like converting a few pages of graphs for posting to a forum or loading as pix on a device (cellphone, etc, vs loading a pdf reader) might be useful.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#10 Post by rcrsn51 »

jpeps wrote:I suppose something like converting a few pages of graphs for posting to a forum or loading as pix on a device (cellphone, etc, vs loading a pdf reader) might be useful.
Oh, OK. :wink:

See the new instructions above for entering a list of pages.

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#11 Post by jpeps »

rcrsn51 wrote: Oh, OK. :wink:

See the new instructions above for entering a list of pages.
:) works nicely, thanks. To be traditional, you could include a page span with "-" , and separate pages with "," (or you can just leave it the way it is :) (might as well use ghostscript's Firstpage/LastPage function)

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#12 Post by jpeps »

Version that adds page span; ex: 4-7
Attachments
peasyp2j.tar.gz
(1.06 KiB) Downloaded 578 times

User avatar
chrome307
Posts: 708
Joined: Thu 15 Jan 2009, 11:00

#13 Post by chrome307 »

Thanks for this it works great :)

One thing I did notice is that the pdf source file needs to contain no spaces in its title overwise you fails to work.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#14 Post by rcrsn51 »

chrome307 wrote:One thing I did notice is that the pdf source file needs to contain no spaces in its title overwise you fails to work.
Fixed! See Version 1.3. Please test and report.

I have also included the code for selecting ranges.

User avatar
chrome307
Posts: 708
Joined: Thu 15 Jan 2009, 11:00

#15 Post by chrome307 »

Thanks again for the update and great work :)

A simple idea but so useful, stops me having to upload whole documents when I can just send some a page( s ) from a pdf.

As and afterthought had you considered adding a jpeg library to this application eg libjpegturbo that could speed up the compression/decompression process?

http://libjpeg-turbo.virtualgl.org/

libjpeg-turbo is a derivative of libjpeg that uses SIMD instructions (MMX, SSE2, NEON) to accelerate baseline JPEG compression and decompression on x86, x86-64, and ARM systems. On such systems, libjpeg-turbo is generally 2-4x as fast as the unmodified version of libjpeg, all else being equal.

It's just a thought!

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#16 Post by jpeps »

Goldberg Variations: (Doesn't post correctly :cry:

Edit: converted to png...works!

( format could be an option? )

BTW/ score was posted as freeware
Attachments
score-2.png
(69.45 KiB) Downloaded 632 times

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#17 Post by jpeps »

Here's one with the PNG code included:
Attachments
peasyp2j.png
(26.56 KiB) Downloaded 592 times
peasyp2j.tar.gz
(1.08 KiB) Downloaded 530 times

User avatar
ravensrest
Posts: 365
Joined: Fri 22 Feb 2008, 16:43
Location: Grants Pass, Oregon

#18 Post by ravensrest »

I've run this beautiful piece of software in Puppy528, Slacko53, Wary53, and Racey53. I used it with ghostscript 8.15, 8.64, 8.71, and 9.05. Everything works fine! Really useful utility for me. Currently installed in all four Puppy variants with ghostscript 8.71.

Thanks for a great tool.
BS

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#19 Post by rcrsn51 »

ravensrest wrote:I've run this beautiful piece of software in Puppy528, Slacko53, Wary53, and Racey53. I used it with ghostscript 8.15...
Ghostscript 8.15 is definitely a problem with some PDFs so it's worthwhile to upgrade.

The version of PeasyP2J that is now included in PeasyPDF goes one step further. It can extract some pages from a PDF document and glue them back together into a new PDF.

You can then run the PDF Builder component to add your own pages to the document.

Thanks for testing.

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#20 Post by jpeps »

rcrsn51 wrote:
ravensrest wrote:I've run this beautiful piece of software in Puppy528, Slacko53, Wary53, and Racey53. I used it with ghostscript 8.15...
Ghostscript 8.15 is definitely a problem with some PDFs so it's worthwhile to upgrade.

The version of PeasyP2J that is now included in PeasyPDF goes one step further. It can extract some pages from a PDF document and glue them back together into a new PDF.

You can then run the PDF Builder component to add your own pages to the document.

Thanks for testing.
I can see some advantage to first creating a folder of separate pages, so that I can add the new page anywhere I want instead of at the end. I could also remove/edit existing pages. Maybe I'm not seeing something?

Post Reply