Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 21 Nov 2019, 10:48
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
How to work with pdf files in Fatdog
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [6 Posts]  
Author Message
Wognath

Joined: 19 Apr 2009
Posts: 422

PostPosted: Mon 08 Feb 2016, 12:49    Post subject:  How to work with pdf files in Fatdog  

On a recent morning, I had to scan documents and prepare PDFs on short notice. This led me to make a list, for future reference, of pdf utilities available in Fatdog 702. I hope it's useful. Additions would be welcome.

text to PDF
Abiword saves to pdf
puppypdf converts abw, doc, rtf, txt to pdf.

image to PDF
1)PeasyPDF works if Ghostscript is installed from the repo.
2)Gimp can export to pdf
3)Command-line utilities:
Code:
jpegtopnm file.jpg | pnmtotiff > temp.tif
tiff2pdf -p letter -j -q 50 temp.tif > file.pdf
Add -F option to expand graphics to fill pdf.

in addition to jpegtopnm, there are 20 others including bmptopnm, pngtopnm, giftopnm. But pstopnm doesn't work: it appears to require Ghostscript.

tiff2pdf jpeg compression option ( -j -q ##) doesn't work with the binary included in Fatdog 702 (distorts colors). The attached newer version (from ftp.remotesensing.org/pub/libtiff/tiff-4.0.6.tar.gz) allows these options to be used. Without compression, the pdf is larger than the jpeg.

combine PDFs
Code:
pdfunite *.pdf combined.pdf
pdfunite file1.pdf, file2.pdf combined.pdf

encrypt pdf
Code:
qpdf --encrypt p4ssw0rd "" 128 -- file.pdf file-encrypted.pdf
The encrypt option is --encrypt user-pwd owner-pwd key-length [restrictions] -- http://qpdf.sourceforge.net/files/qpdf-manual.html
tiff2pdf.tar
Description  Newer binary with working jpeg compression
tar

 Download 
Filename  tiff2pdf.tar 
Filesize  70 KB 
Downloaded  157 Time(s) 
Back to top
View user's profile Send private message 
jamesbond

Joined: 26 Feb 2007
Posts: 3376
Location: The Blue Marble

PostPosted: Mon 08 Feb 2016, 13:37    Post subject: Re: How to work with pdf files in Fatdog  

Thanks Wognath.

Wognath wrote:
But pstopnm doesn't work: it appears to
require Ghostscript.
Anything that reads or outputs to Postscript ("PS") will most likely need ghostscript.

Quote:
tiff2pdf jpeg compression option ( -j -q ##) doesn't work with the binary included in Fatdog 702 (distorts colors).
Ah, that's why I didn't see it - I used black and white image for testing (and it looked okay). I'll get tiff2pdf updated in the repo.

Another tool to consider is pdftk https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ which you can get from the repo. It has a rather large dependency though, you need to install aaa-gcc-libs-full too.

_________________
Contributed Fatdog64 packages
Back to top
View user's profile Send private message 
rcrsn51


Joined: 05 Sep 2006
Posts: 12778
Location: Stratford, Ontario

PostPosted: Mon 08 Feb 2016, 13:39    Post subject:  

Nice work. Here are some observations.

Puppypdf should have been retired long ago. It just sends the document to Abiword, which produces an inferior PDF. The preferred method is to load the document into a word processor and use Print > Print to File.

Code:
jpegtopnm file.jpg | pnmtotiff > temp.tif
tiff2pdf -p letter -j -q 50 temp.tif > file.pdf

Peasyscan has switched to using tiff-tools and the matching libtiff for saving a scan to PDF. I was getting better results than with Ghostscript.

I debated incorporating libtiff into PeasyPDF, but PeasyPDF already uses Ghostscript for things like extraction.

[Edit] If you want to combine a bunch of JPEGs into a single PDF, the BEST tool is img2pdf. It is discussed in the PeasyPDF how-to.
Back to top
View user's profile Send private message 
rufwoof


Joined: 24 Feb 2014
Posts: 3631

PostPosted: Mon 08 Feb 2016, 15:32    Post subject:  

MasterPDFeditor is a great program IMO. You can add attachments etc.

I've installed the latest version direct from CodeIndustry https://code-industry.net/free-pdf-editor/ and its working really well.
p.jpg
 Description   
 Filesize   49.18 KB
 Viewed   342 Time(s)

p.jpg

Back to top
View user's profile Send private message 
step

Joined: 04 May 2012
Posts: 1220

PostPosted: Mon 08 Feb 2016, 16:06    Post subject:  

The contrib repo includes also:

wkhtmltopdf 0.12.3 dev-79ff51e (PDF cli converter)
wkhtmltopdf and wkhtmltoimage are open source (LGPLv3) command
line tools to render HTML into PDF and various image formats
using the Qt WebKit rendering engine. These run entirely
"headless" and do not require a display or display service.

https://bitbucket.org/wkhtmltopdf/wkhtmltopdf
http://wkhtmltopdf.org/downloads.html

_________________
Fatdog64-802|+Packages|Kodi|Findnrun|+forum|gtkmenuplus
Back to top
View user's profile Send private message 
Wognath

Joined: 19 Apr 2009
Posts: 422

PostPosted: Mon 11 Apr 2016, 14:08    Post subject:  

Sorry to bump after so long. I just found this and thought it would be useful to add.
My original post was about utilities already present in Fatdog. But if libreoffice is installed (FD600 repo), a fairly fast command-line conversion of documents to pdf is available:
Code:
/opt/libreoffice3.6/program/soffice --headless --convert-to pdf --outdir ~/NewDir file-to-convert
I have tried this on ppt, doc, xls, jpg and htm files. Occasional format problems or dropped image, esp. htm. Links survive the conversion.
Replacing file-to-convert by * does all files in working directory.
--outdir is optional; without it, output goes to working directory
Similar commands will convert to other formats, but a filter may need to be specified. See
https://ask.libreoffice.org/en/question/2641/convert-to-command-line-parameter
Although it doesn't open the gui, this creates a large (>20M) config file Sad
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [6 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0791s ][ Queries: 12 (0.0112s) ][ GZIP on ]