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 Wed 16 Oct 2019, 12:37
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 [113 Posts]   Goto page: Previous 1, 2, 3, ..., 6, 7, 8
Author Message
disciple

Joined: 20 May 2006
Posts: 6980
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: 6980
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: 6980
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: 12713
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: 6980
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.

_________________
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: 6980
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: 6980
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: 6980
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 
Display posts from previous:   Sort by:   
Page 8 of 8 [113 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.1264s ][ Queries: 13 (0.0732s) ][ GZIP on ]