PeasyPDF Convert/Join/Extract/Print

Word processors, spreadsheets, presentations, translation, etc.
Message
Author
User avatar
charlie6
Posts: 1230
Joined: Mon 30 Jun 2008, 04:03
Location: Saint-Gérard / Walloon part of Belgium

#25 Post by charlie6 »

Hi,
the above post was relative to the conversion from a .BMP file to a .PDF file, using the Quick option
Further to that previous post, i've tried to manually perform the commands used in /usr/sbin/peasypdf:
#bmptopnm myfileORIG.BMP > myfileORIG.pnm
# pnmtops myfileORIG.pnm > myfileORIG.ps
# ps2pdf myfileORIG.ps
and got a better result than the one using peasypdf using the «fill the page» option (i.e. imho using the pnmtops -noturn -center -equalpixels command) or leaving empty those option boxes.

i also edited /usr/sbin/peasypdf script and added those lines at line 51 through 55:

Code: Select all

    BMP)                                                                  #added    charlie6
      bmptopnm "$F" | pnmtops > /tmp/pptemp.ps 
      ps2pdf /tmp/pptemp.ps $PEASYPATH/$FN
      rm /tmp/pptemp.ps
      ;;
which does not use the $OPTION variable ... also without getting better results.

Peasypdf keeps producing the same result ... :? so i wonder how to do.
Thanks for any answer
Charlie

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

#26 Post by rcrsn51 »

What Puppy are you using?

When PeasyPDF receives a non-linux file type like BMP, it sends it to Abiword for conversion to PDF. So you don't get very good quality.

The notes recommend that you use mtpaint to convert the BMP to PNG, then load it in PeasyPDF.

In any case, the BMP) line in your script should be PC).

Where did you get the bmptopnm command? I don't see it in any standard Puppies. Or did it come with samp?

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

#27 Post by charlie6 »

Hi rcrsn51,
Thanks for replying !
Here i'm running wheezy-3.5.2.5 (rather outdated ...is'nt...? :? ).
Ooops...i did'nt read the notes ...sorry.

Why BMP ...? because i have a memory fax modem that receives faxes with PC off power - managing soft runs under wine - faxes to be archived can be exported under BMP format only. 8) .

Having a conversion tool with minimal readability losses is important as faxed documents quality is sometimes weak.

I found the package netpbm which has a lot of graphic conversion tools, with bmptopnm among others;
for wheezy, download here:
https://packages.debian.org/wheezy/netpbm
it needs also libnetpbm extra dep, link given on the same page.

Thanks for your tip ! :D This works here: adding

Code: Select all

    PC)  
      bmptopnm "$F" | pnmtops > /tmp/pptemp.ps
      ps2pdf /tmp/pptemp.ps $PEASYPATH/$FN
      rm /tmp/pptemp.ps
      ;; 
at line 50 of /usr/sbin/peasypdf script and its working
(i have checked that having commented out the script lines calling abiword (from *) and following).

Sam2p comes with only a binary file that has all conversion tools in it; it does not need extra deps.

Hope this help
Charlie

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

#28 Post by rcrsn51 »

Excellent. The latest version of PeasyPDF (posted on page 1) removes the reliance on Abiword.

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

#29 Post by rcrsn51 »

PeasyPDF v2.6 is posted on the first page.

Thanks to FeodorF for testing.

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

peasypdf-2.8 french translation

#30 Post by charlie6 »

Hi rcrsn51,
many thaks for this awesome update :) :) !
here is a peasypdf-2.8 french translation
enjoy !
Charlie

220514 edited:
pet re-uploaded: modified tanslation in "Convert" thumbnail.
140514 edited:
pet re-uploaded with some left typos fixed + fine tuned
290414 edited:
pet re-uploaded with some left typos fixed + fine tuned
Attachments
peasypdf_220514_french_fr_locale-2.8.pet
(3.54 KiB) Downloaded 831 times
peasypdf_scrnsht.png
(154.9 KiB) Downloaded 851 times
Last edited by charlie6 on Thu 22 May 2014, 15:40, edited 3 times in total.

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

#31 Post by rcrsn51 »

Excellent. It looks like I gettexted everything. :wink:

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

#32 Post by charlie6 »

Hi rcrsn51,
rcrsn51 wrote:Excellent. It looks like I gettexted everything. :wink:
...ooops :oops: quite everything...?
please see re-uploaded french locales pet on previous page.
sorry,
Charlie

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

french locale update

#33 Post by charlie6 »

Hi,
french locale: on page 2 this thread, please find new update (some left typos fixed)
Charlie

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

#34 Post by charlie6 »

Hi,

Peasypdf-2.8 reports error ("non valid file, blanks present ...") if converting files stored on an USB stick or whatever /mnt/folder.

Was working OK on version 2.4.

HTH, Charlie

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

#35 Post by rcrsn51 »

charlie6 wrote:Peasypdf-2.8 reports error ("non valid file, blanks present ...") if converting files stored on an USB stick or whatever /mnt/folder
Please state what conversion procedure and what kind of file you are converting.

What Puppy version are you using?

I have done a bunch of tests and cannot find a problem. Please describe exactly step-by-step what you are doing.

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

#36 Post by charlie6 »

Hi rcrsn51,
Please state what conversion procedure and what kind of file you are converting.
thanks for replying ...
Ooops .. :oops: ! i found i was trying to convert to pdf a bitmap graphic image that version 2.8 cannot do.
I got a succesfull try with a "normal" png image stored on an USB stick.
... so i was doing as with the version 2.4 in which i added the bmp option (see http://murga-linux.com/puppy/viewtopic. ... 0&start=24.

No hope: adding those bmp conversion codes do not work in version 2.8.. :cry:
Any idea to get bmp conversion working with 2.8 ?

Thanks in advance
Charlie

ps:
1. i have uploaded a new french locale pet »»»-------> see page 2
2. here using dpup-wheezy3.5.2.5 and 3.5.2.11
Last edited by charlie6 on Thu 22 May 2014, 20:19, edited 1 time in total.

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

#37 Post by rcrsn51 »

Starting at Line 46

Code: Select all

    TIFF)
      tifftopnm "$CONVERTNAME" | pnmtops $OPTIONS > /tmp/pptemp.ps
      ;;
So you should be able to add

Code: Select all

PC)                                                                  
      bmptopnm "$CONVERTNAME" | pnmtops $OPTIONS > /tmp/pptemp.ps
     ;; 
Don't forget to also install bmptopnm.

[Edit] I tried this myself in Slacko 56 and it worked fine. I had to get bmptopnm from Slackware - the Debian version didn't work.

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

#38 Post by charlie6 »

Hi again rcrsn51,
rcrsn51 wrote:Starting at Line 46

Code: Select all

    TIFF)
      tifftopnm "$CONVERTNAME" | pnmtops $OPTIONS > /tmp/pptemp.ps
      ;;
So you should be able to add

Code: Select all

PC)                                                                  
      bmptopnm "$CONVERTNAME" | pnmtops $OPTIONS > /tmp/pptemp.ps
     ;; 
Don't forget to also install bmptopnm.

[Edit] I tried this myself in Slacko 56 and it worked fine. I had to get bmptopnm from Slackware - the Debian version didn't work.
OK! added; and works fine ! bmptopnm was already installed (it is included in netpbm).

i also noticed another options for graphic formats for folder conversion from line 94 in the original version 2.8;
so i got a try adding there:

Code: Select all

    PC)
      bmptopnm "$F" | pnmtops $OPTIONS > /tmp/pptemp.ps
      ;;
and it worked fine on a folder having several file formats in it: jpeg , png, gif and bmp. The "assemble in one pdf" box was checked, and it resulted one pdf file with as many pages as the number of files in the folder. Except the gif file which has been ignored.

Just one thing: what is "PC)" standing for? In a previous post, you suggested to replace BMP) by PC), did'nt you?

Now, i 've added one GIF options around line 46:
assuming /usr/bin/giftopnm is present (also comes with netpbm)

Code: Select all

    GIF)
      giftopnm "$CONVERTNAME" | pnmtops $OPTIONS > /tmp/pptemp.ps
      ;;
and around line 94:

Code: Select all

    GIF)
      giftopnm "$F" | pnmtops $OPTIONS > /tmp/pptemp.ps
      ;;
and it works also for a single file as also for a folder.

Thanks a lot
Charlie

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

#39 Post by rcrsn51 »

Excellent. Lines 38 and 90 call the "file" command. It reports a BMP file as "PC bitmap", so PeasyPDF identifies it as "PC".

Here is a tip: If you have a bunch of BMP fax files and want to convert them into one PDF, you should probably select "Ignore" instead of "Portrait" from the drop-down list. This will get you a PDF document with letter-sized pages.

Otherwise, PeasyPDF assumes that these are small graphics images like photos and packages them in a smaller 5x7 format.

Maybe instead of "Ignore", some better choices would be "Letter" and "A4"?

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

#40 Post by rcrsn51 »

@Charlie:

I have posted v2.9. This version gives you more choices when you convert a set of graphics to PDF and combine them into one document.

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

#41 Post by charlie6 »

Hi rcrsn51,
Many thanks for this v-2.9 :) !
Looks like a bit from v-2.4 ...isn't ? i appreciate much !
Now downloaded and installed; i'll report conclusions in a while;
The «wise» user «who-is-knowing-what-he-does :? » would be supposed to add the specific above-already-posted codes for PC) (=.bmp) and GIF) (= .gif) graphic formats inside /usr/sbin/peasypdf script + have previously installed bmptopnm + giftopnm binaries (for dpup-wheezy users and maybe others, get them from:
http://ftp.de.debian.org/debian/pool/ma ... 1_i386.deb ... or from your favorite repo)..

Attached is v2.9 french locale update with its PeasyPDF.desktop file in it.

Cheers,Charlie
ps: my trunk runs with fr_BE locale setting ... this is of course valid for fr locale .. :)
Attachments
MoManager-fr_BE-peasypdf-2.9.tar.gz
PeasyPDF-2.9 french locale update+PeasyPDF.desktop file
(3.67 KiB) Downloaded 734 times

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

added postscript conversion

#42 Post by charlie6 »

Hi rcrsn51,
For fax sending, it is sometime needed to convert pdf files to ps (postscript files).
The use of efax-gtk indeed returns an error message when trying to fax pdf files, as efax requires postscript files as input.
I use to use sam2p, another command line file converter, to achieve that conversion step.
:idea: As pdftops is default present in dpup-wheezy, and digging a bit in peasypdfs script, i got a try adding:
- the following code at line265:

Code: Select all

elif [ $EXTRACTPS = "true" ]; then
  pdftops -f $PAGE -l $PAGE "$PDFNAME" - >> $EXTRACTPATH/EXTRACTED.ps
- and a PS button in the extract thumbnail: added this code at line489:

Code: Select all

		<radiobutton> 
          <variable>EXTRACTPS</variable>
          <label>PS</label>
        </radiobutton>
So it's ( ...«Yesss!» :o ) working !

:idea: Another idea now: straight integrate the ps conversion within the PRINT thumbnail:
Efax-gtk users have efax-gtk as printer - named FaxPrinter in the user's manual - listed in the print menu of their applications provided they have defined it doing in command line:

Code: Select all

/usr/sbin/lpadmin -p FaxPrinter -E -v socket://localhost:9900
Then, in peasypdf, that FaxPrinter is also listed in the printer list. But as pdf file cannot be straight efax printed, it would be nice to have some codes lines roughly looking like the following in peasypdfs script (i believe around line 298) ...(sorry if a lot of syntax mistakes :oops: ) :
if PRINTER=FaxPrinter
then pdftops $PRINTPDFNAME > /tmp/$PRINTPDFNAME/TOBEFAXED.ps
lp $OPTIONS -d $PRINTER TOBEFAXED.ps
fi
but ATM i'm not able to compose such a script in an acceptable delivery time... :cry:

I'll be nice if someone could do it...(i do not ever dare doubting you could'nt... :wink: )

Tons of thanks in advance !
Cheers, Charlie
Attachments
peasypds_faxprinter.jpg
FaxPrinter listed in printers list
(25.52 KiB) Downloaded 717 times
peasypdf_with_ps_button.jpg
added PS button for pdf to postscript conversion
(28.65 KiB) Downloaded 714 times

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

#43 Post by rcrsn51 »

Nice work! Postscript used to be more important because an application like your word processor would send a print job to CUPS formatted as PS.

But that changed recently so the application now sends the print job as a PDF.

However, the PeasyPDF Print tool should still accept a PS file. I tried this myself by running Abiword, creating a document and using Print > Print to File > Postscript. I then printed that PS document to my laser printer using PeasyPDF.

Have you already tried this with your fax? I think that you have, but I wasn't completely sure.

Or are you just looking to simplify things by converting a PDF to PS and then printing it, all in one step? This may be possible.

If you look in the PeasyPDF CONVERT section, it can actually convert a Poscript file to a PDF. But I forgot to add it to CONVERTALL!

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

#44 Post by charlie6 »

Hi rcrrsn51,
about efax-gtk sending pdf files ...
I was looking doing it in one step.
Have you already tried this with your fax? I think that you have, but I wasn't completely sure.
in fact efax-gtk-3.2.13 (latest version in use here) does it (see screenshot attached) ... i remenber although some users reporting difficulties sending straight pdf files.
The efax-gtk README tells:
Sending faxes
-------------
Before sending a fax, it must be specified in the "Fax to send" box.
It must be in postscript format (a format produced by all Unix/Linux
word and document processors), and will be converted by the program
into the correct tiffg3 fax format. Recent versions of ghostscript
(which is used to convert the postscript file to tiffg3 fax images)
will also accept files in PDF format
.
So i believe my ghostscript version allows it .. :D ...for one sigle page document, as also for multipage document (also just tested).
If you look in the PeasyPDF CONVERT section, it can actually convert a Poscript file to a PDF.
»»»-----> That's great !

Thanks again !
Charlie
Attachments
sending pdf document using efax-gtk through peasypdf-2.9.jpg
sending pdf file using efax-gtk
(56.04 KiB) Downloaded 705 times
Last edited by charlie6 on Sat 24 May 2014, 14:48, edited 1 time in total.

Post Reply