PeasyPDF Convert/Join/Extract/Print

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

#81 Post by rcrsn51 »

PeasyPDF v3.6 has a new Landscape option in the Convert tool. This turns the PDF page sideways so a landscape image will fit in its proper orientation.

Update: PeasyPDF v3.7 has two new Custom sizes in the Convert tool. If the original graphic has low resolution, the resulting PDF will be small and may require zooming in your PDF viewer. The Custom+ setting increases the initial size of the PDF. Similarly, the Custom- size shrinks a PDF made from a hi-res image that may overflow the screen.

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#82 Post by slavvo67 »

Have you explored adding options such as electronic signatures? I've been seeking an electronic signature solution in Puppy for quite sometime...

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

#83 Post by rcrsn51 »

slavvo67 wrote:Have you explored adding options such as electronic signatures?
No. That's well beyond the scope of this project.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#84 Post by greengeek »

slavvo67 wrote:I've been seeking an electronic signature solution in Puppy for quite sometime...
I think it might be worth opening a thread for that. There are various ways of adding a signature (and different meanings to the term "electronic signature" eg: see this). I feel sure you would get a variety of suggestions that might help.
.

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

#85 Post by rcrsn51 »

PeasyPDF v3.8 has a new tool in the Extract section for dealing with large PDF files. See the instructions in the main post.

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#86 Post by step »

Hi rcrsn51, I'm basing this comment on version version 2.3 2012-11-15, as found in Fatdog64-710a2 (I guess it's the same as in Fd-702). I was converting a single jpeg file to PDF, and the resulting image was smaller than the original. Looking into the command pipeline that does the conversion in that version, I see that the input jpeg dpi value isn't taken into account. My jpeg is 150x150 dpi, but it gets converted assuming a default 300x300 dpi value, so it looks 1/4th the size in the final PDF, and so it gets printed, which is a problem.
I can suggest a slight variation of the command pipe line, assuming that you can extract the dpi value NxN from the input image:

Code: Select all

jpegtopng in.jpg | pnmtops -dpi=NxN -equalpixels -center -noturn |
  ps2pdf -sPAPERSIZE=letter - - > out.pdf
I've thrown in a PDF paper-size option too, which my peasypdf version doesn't support for this type of conversion.
This is all I wanted to say about peasypdf.

As an aside, the following code wraps up this idea in a shell function that can be used to convert jpeg to pdf directly at the terminal prompt or in a larger script. It uses exiftool to extract the dpi value from the input image. Exiftool works well but it isn't standard in Puppy Linux. I don't know how to extract dpi info in a way that works across all Puppies.

Code: Select all

_jpg2pdf() # $1-input.jpg [$2-output.pdf [$3-paper-size [$4-xdpi'x'ydpi]]] {{{1
# jpg2pdf /root/in.jpg => /root/in.jpg.pdf LETTER size
# jpg2pdf /root/in.jpg /tmp/out.pdf a4 => /tmp/out.pdf A4-size
# jpg2pdf /root/in.jpg /tmp/out.pdf letter 200x200 => /tmp/out.pdf LETTER-size 200x200 dpi
# If $4 (dpi) is "" exiftool is used to extract dpi info from $1
{
  local outpdf="$1.pdf" papersize dpi
  [ -n "$2" ] && outpdf=$2
  papersize=${3:-letter}
  dpi=${4:+-dpi=}$4
  [ -z "$dpi" ] && dpi=$(
    exiftool -p '${xresolution}x${yresolution}' "$1" |
    sed -ne '/1x1/ q; s/^/-dpi=/p'
    )
  jpegtopnm "$1" |
  pnmtops $dpi -equalpixels -center -noturn |
  ps2pdf -sPAPERSIZE="$papersize" - - > "$outpdf"
}
The lines that extract dpi data need explaining. First, exiftool prints the X and Y dpi values separated by 'x'. If it can't find such values in the file, exiftool prints '1x1' (peculiar), so we need to treat this as a special case, when output pipes into sed. The first part of the sed script "/1x1/ q;" looks for '1x1' and quits sed immediately without printing anything. Effectively this sets the dpi shell variable to "". If instead sed finds something different than '1x1', i.e., 150x150 in my case, it prepends "-dpi=" to it and prints the result. This effectively sets the dpi shell variable to "-dpi=150x150", in my case. Of course, this works for all dpi values.
If exiftool is replaced with another command, one needs to adapt the first part of the sed script to catch the null dpi value condition. For instance, a hypothetical getdpi command that returns "" when it can't find the dpi value could be processed with sed -n '/^$/ q; s/^/-dpi=/p'.
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#87 Post by greengeek »

Hi rcrsn51 - just wanted to say another thanks for peasy pdf (I'm using v3.2). My wife is applying for a new teaching job and I had to scan 5 colour documents as pdfs which came to a total of about 11Mb which I wasn't keen to email - so I used peasy pdf to combine them and it produced one nice document which totalled 900kb with no apparent loss of quality (to my eyes at least...)

Much nicer to email.

cheers!

User avatar
jplt_bis
Posts: 69
Joined: Mon 20 Feb 2017, 19:06
Location: Planete Terre

#88 Post by jplt_bis »

Hello all,

is it possible to (bash) merge multiple PDF files with PeasyPDF , i have about 20 pdfs to merge in one pdf !

Thanks for your help .

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

#89 Post by rcrsn51 »

In the Join section, click New and View. This opens the project window.

Drag links from your 20 PDFs into this window.

Click Join.

User avatar
jplt_bis
Posts: 69
Joined: Mon 20 Feb 2017, 19:06
Location: Planete Terre

#90 Post by jplt_bis »

So wonderful , it works very well.

Maybe update the first post to add this little trick, because i think a lot of people would be interested !

Another fact that, i tested 2 other tools to join pdfs in linux pdfunite , gs (ghostscript), pdftk but all fails because "merge failed your pdf is encrypted" ! but PeasyPDF do the job ;-)


Great thanks rcrsn51 you save my day :D

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

#91 Post by rcrsn51 »

jplt_bis wrote:So wonderful , it works very well.
Excellent.
Maybe update the first post to add this little tricks
Good idea.
Another fact that i tested 2 other tools to join pdfs in linux pdfunite , gs (ghostscript), pdftk but all fails because "merge failed your pdf is encrypted" !
That may occur because your PDFs are a newer version and the tool doesn't recognize them. However PeasyPDF uses Ghostscript to join PDFs.

What Puppy version are you using and which version of PeasyPDF?

User avatar
jplt_bis
Posts: 69
Joined: Mon 20 Feb 2017, 19:06
Location: Planete Terre

#92 Post by jplt_bis »

I'am on tahrpup 6.0.5 and peasypdf 3.3

Puppyt
Posts: 907
Joined: Fri 09 May 2008, 23:37
Location: Moorooka, Queensland
Contact:

#93 Post by Puppyt »

rcrsn51 wrote:In the Join section, click New and View. This opens the project window.

Drag links from your 20 PDFs into this window.

Click Join.
oooooh great tip! Will definitely be using that in future - with dragging 10+ single successive files across into the 'join' dialogue I often think I've lost my place, or position in the queue. Cheers rcrsn51 :)
Search engines for Puppy
[url]http://puppylinux.us/psearch.html[/url]; [url=https://cse.google.com/cse?cx=015995643981050743583%3Aabvzbibgzxo&q=#gsc.tab=0]Google Custom Search[/url]; [url]http://wellminded.net63.net/[/url] others TBA...

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

#94 Post by rcrsn51 »

The advantage of adding files one-by-one is that you get a specific order. In a PDF document, that might be important.

If you just drag a bunch of files into the project folder, they will be joined in their alphabetical filename order.

oldprinter
Posts: 18
Joined: Sun 12 Nov 2017, 23:42

#95 Post by oldprinter »

I've been using the 'Join' feature for awhile now.
I produce a pdf with individual pages (in OpenOffice), drop that pdf into Bookbinder 3, which creates pdf's of the signatures, then I use Join to assemble a single pdf of the project as sigs of the printer's pairs. Then I have just one file to print out for the project. Projects average 240 pages and 8 sigs. I add tic marks to keep the sigs easily indentified (and in correct order for binding).

I prefer to drop in sig pdfs one at a time, not batch drop, so if there is an error, it's mine. (Checklists are very helpful)

Tom

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#96 Post by greengeek »

When I scan a document and save as pdf I end up with a larger file than I want. Then I use peasypdf to shrink it by creating a blank page and combining it with the scanned doc pdf.

Somehow peasypdf creates a smaller output file than the original - despite it having an extra page. (No visible loss of quality as far as I can tell)

I am wondering if there are other methods allowing peasypdf to shrink an input pdf?

Are there ways to have a "variable shrink" such that an input pdf that is 2MB in size could be shrunk to sizes like 1MB, 500KB, and 250KB etc depending on the needs of the user?

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

#97 Post by rcrsn51 »

What scanning tool are you using?

If it's PeasyScan, there may be ways to generate a smaller PDF.

User avatar
charlie6
Posts: 1230
Joined: Mon 30 Jun 2008, 04:03
Location: Saint-Gérard / Walloon part of Belgium

#98 Post by charlie6 »

Hi,
Also regularly need to shrink huge pdf :?

here using the following command line in a terminal opened in the directory having the file to shrink «myfile2shrink.pdf» in it:
# gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=/path/to/mydir/myfile_shrinked.pdf myfile2shrink.pdf
As examples: using those settings,
- just went to shrink a 299K - black and white - 5 pages document to 173K; duration ca. 2 sec.; so it works for multipages.
- and shrinked a 2,5MB architects drawings to ca. 122K. (see resolution comparison in attached screenshots)

I did not yet have dug in it to control the shrink percentage :oops: .
It does not work that good to shrink pictures - just get a try for check.

HTH
Charlie
Attachments
before_after_shrink1.png
Left: 2,5MB file / Right: shrinked 122K
(138.78 KiB) Downloaded 633 times

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#99 Post by greengeek »

rcrsn51 wrote:What scanning tool are you using?
So far I have just been using the standard xsane that comes with Slacko 5.6

Typically I am scanning colour or greyscale at 200 or 300 dpi (invoices or technical documents containing mix of graphics and text) and each page is often 500KB - 2MB until I run it through peasypdf.

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

#100 Post by rcrsn51 »

In Xsane, how are you saving the image - as a PDF? or as a graphic?

Do you have the latest version of PeasyPDF?

In Xsane, save the image as a JPEG, then use PeasyPDF to convert it to a PDF. There are several tools for this.

Post Reply