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 Tue 19 Nov 2019, 12:23
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Documents
Pdfshuffler .sfs - Edit pdfs :) fantastic!
Post new topic   Reply to topic View previous topic :: View next topic
Page 8 of 8 [117 Posts]   Goto page: Previous 1, 2, 3, ..., 6, 7, 8
Author Message
disciple

Joined: 20 May 2006
Posts: 6988
Location: Auckland, New Zealand

PostPosted: Tue 01 Oct 2019, 05:47    Post subject:  

I haven't tried the linux version lately, but the Windows Foxit Reader has a good interface for attaching files. Even Adobe Reader can attach files on Windows, although the interface isn't good.
_________________
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6988
Location: Auckland, New Zealand

PostPosted: Tue 01 Oct 2019, 05:49    Post subject:  

https://github.com/arrufat/pdftag
Gui to edit pdf metadata, written in vala and uses poppler

_________________
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6988
Location: Auckland, New Zealand

PostPosted: Tue 08 Oct 2019, 02:42    Post subject:  

People might find these snippets from http://www.imagemagick.org/Usage/formats/#ps interesting:
Quote:
Multi-paged PDF Documents...

You can use perl to combine multiple PDF files, without resorting to a IM, and its rasterization problem...

Code:
#!/usr/bin/perl
#  Script   pdf-combiner.pl
use strict;
use warnings;
use PDF::Reuse;

prFile('combo.pdf'); # Output.
for (qw/a b c d/) # Inputs.
{
  prImage("result_$_.pdf");
  prPage();
}
prEnd();


You can also use a JAVA toolkit to merge IM generated images into a PDF producing a better PDF than a simpler one that IM will generate...

Code:
#!/bin/bash

for x in ./*.jpeg
do
    echo $x to ${x}.pdf
    convert $x -quality 75 ${x}.pdf
done

echo Merging...
java tool.pdf.Merge *.pdf

_________________
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER
Back to top
View user's profile Send private message 
rcrsn51


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

PostPosted: Tue 08 Oct 2019, 06:49    Post subject:  

Can you please clarify this? Is the objective to merge some individual PDFs into one file? Or is it to encapsulate some JPEG images into a PDF?
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6988
Location: Auckland, New Zealand

PostPosted: Thu 10 Oct 2019, 08:37    Post subject:  

disciple wrote:
Another program I don't think I've mentioned, particularly for doing ocr on scanned pdfs, is the Windows freeware "pdf-xchange viewer", which apparently runs well in Wine.

I know there are some other topics here about linux OCR engines and guis, but I thought I'd mention ocrmypdf, which is probably the easiest solution for adding a layer of ocred text to a raster pdf. It is from the same author as pikepdf, which is basically a python wrapper library for qpdf.

EDIT

FWIW I did some testing with ocrmypdf.
IIRC the ocr backend it uses is tesseract. Recognition was perfect except for white space; so more accurate than pdf-xchange, which I had handy for a comparison.
It shrinks test files from the scanner at my work a bit. If I install jbig2enc (which requires leptonica) it shrinks monochrome test files even more.

I wanted to know how to remove scanned text so I converted to a new pdf using pdftocairo, which removed the text and made the file a lot bigger, so presumably it reencoded without jbig2. Interestingly, if I rerun that output through ocrmypdf the result is even smaller. I was dealing with a very small single page file though, so metadata and stuff might show as a big difference in size which wouldn't be noticeable with a large file.

_________________
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

Last edited by disciple on Thu 24 Oct 2019, 16:04; edited 1 time in total
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6988
Location: Auckland, New Zealand

PostPosted: Thu 10 Oct 2019, 08:40    Post subject:  

rcrsn51 wrote:
Can you please clarify this? Is the objective to merge some individual PDFs into one file? Or is it to encapsulate some JPEG images into a PDF?

I presume you are asking about the snippets in my previous. One appears to be for combining pdfs and the other for creating a pdf from some images.

_________________
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6988
Location: Auckland, New Zealand

PostPosted: Thu 10 Oct 2019, 08:56    Post subject:  

This is the best solution I can come up with for converting vector pdf to raster pdf. You can probably tell it is pulled from a script I run from a magic button to automate all kinds of useful things:
Code:
# read in the output resolution (DPI)
read RES <image_resolution.txt
# check that RES is a number
if ! [[ "$RES" =~ ^[0-9]+ ]]
then
 RES="300"
 echo $RES>image_resolution.txt
fi
for i in !(*-rasterised).pdf
 do (
  mkdir "/tmp/$i"
  pdftocairo -jpeg -r $RES "$i" "/tmp/$i/0"
  jpegoptim "/tmp/$i/0"
  img2pdf -o "${i%%.*}-rasterised.pdf" "/tmp/$i/"*
# this method results in ugly pdfs sometimes, regardless of the compression and quality specified
#  ( convert -density $RES "$i" -compress jpeg -quality 75 -flatten "${i%%.*}-rasterised.pdf" ) &
# this method doesn't cope with spaces in filename
#  ( convert -density $RES {"$i","$i"-rasterised}.pdf ) &
  rm -R "/tmp/$i" ) &
 done
unset RES

Change the compression and quality arguments depending on the nature of your pdfs.
I thought that a tool like pdftocairo would be able to convert directly to a raster pdf, but I couldn't find any that can. It wasn't even obvious how to do it with ghostscript.
Imagemagick will convert from vector to raster pdf (using ghostscript), and is a much simpler (but slower) solution for multi page documents, but sometimes it produces bad results (even though it always produces good results when converting to normal raster image formats.)

EDIT - added jpegoptim line, which saves 10% of file size in my test.

_________________
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

Last edited by disciple on Thu 10 Oct 2019, 17:19; edited 1 time in total
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6988
Location: Auckland, New Zealand

PostPosted: Thu 10 Oct 2019, 17:16    Post subject:  

Quote:
Change the compression and quality arguments depending on the nature of your pdfs.

I mean choose the right raster format (-png, -jpeg, -tiff options) to convert to with pdftopoppler, referencing how img2pdf will handle it:
Quote:
| JPEG | any | direct |
| JPEG2000 | any | direct |
| PNG (non-interlaced) | any | direct |
| TIFF (CCITT Group 4) | monochrome | direct |
| any | any except CMYK and monochrome | PNG Paeth |
| any | monochrome | CCITT Group 4 |
| any | CMYK | flate |

You might need to use the -mono or -gray options.
It seems poppler to cairo doesn't actually allow you to specify jpeg quality or similar. Maybe an alternative like mutool would.

_________________
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6988
Location: Auckland, New Zealand

PostPosted: Thu 24 Oct 2019, 18:01    Post subject:  

disciple wrote:
2. pdf-xchange is the best "free" option I've seen for editing pdf bookmarks (no, this isn't a premium feature).

It looks like I never mentioned jpdfbookmarks in this thread, which is generally pretty good, but can't format the bookmarks, and seems to have a bug in its logic with export/import of complex outlines.
Two .NET/Mono based alternatives that look very good although I haven't tested extensively:
http://handyoutlinerfo.sourceforge.net/
https://sourceforge.net/projects/djvubookmarker/
Both work with pdf and djvu, the second is a lot more powerful it seems (formatting in particular). The first also provides a command line tool.
There is also a Windows freeware called "PDF bookmarks" from Skysof, which I haven't looked at at all.

_________________
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

Last edited by disciple on Thu 24 Oct 2019, 19:43; edited 2 times in total
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6988
Location: Auckland, New Zealand

PostPosted: Thu 24 Oct 2019, 18:11    Post subject:  

https://willus.com/k2pdfopt optimizes pdf/DJVU files for small screens, including reflow even of scanned files!
Check out the example screenshots on the home page.

_________________
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6988
Location: Auckland, New Zealand

PostPosted: Thu 24 Oct 2019, 19:46    Post subject:  

Another couple of options for cropping pdfs:
https://pypi.org/project/pdfCropMargins/ powerful python command-line tool, with gui.
http://pdfcrop.sourceforge.net/ script which uses ghostscript and pdfedit.

_________________
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6988
Location: Auckland, New Zealand

PostPosted: Thu 24 Oct 2019, 23:54    Post subject: Re: Briss - gui for cropping pdfs (Java based)
Subject description: apply the same crop to all similar pages
 

disciple wrote:
disciple wrote:
Another interesting Java based tool - just for cropping:
http://sourceforge.net/projects/briss/

Quote:
This is a small application to crop PDF files. It helps the user to decide what should be cropped by creating a overlay of similar pages (=>all pages within a pdf having the same size, orientation(even/odd)).

Very similar to Briss, and also Java, is Pdf scissors

EDIT 20191021
I just cropped on Windows a study Bible with almost 2000 pages successfully using Briss, and it was very fast. Pdfscissors failed for some reason - I don't know if it was to do with the file size or something, but it took quite a lot longer and appeared to succeed, but the pages were not actually cropped.
I get the same results with a couple of other New Testaments; I guess perhaps Briss is succeeding because it is shipped on Windows with a newer version of iText than pdfscissors is...?

FWIW I just noticed there's a "pre-release" of an updated version of Briss at https://github.com/mbaeuerle/Briss-2.0/releases

_________________
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 8 of 8 [117 Posts]   Goto page: Previous 1, 2, 3, ..., 6, 7, 8
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Documents
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.0939s ][ Queries: 12 (0.0495s) ][ GZIP on ]