From Newsgroup: comp.text.pdf
Good morning
and thank you Peter for responding.
I have tried to be as specific and precise as possible, but there
are zones where my Engish may not really be sufficient.
Let me first repeat the phrase from the bottom of my OP, above:
rCLI would like to know if rCo once the resolution problems solved rCo fop produces smaller tiff files.rCY
Now I react ;)
Peter Flynn wrote in comp.text.pdf:
On 16/06/2026 08:31, Michael Uplawski wrote:
I want to use Apache FOP to create TIFF from XML (via FO). The
objective is to transform these TIFFs to PDF and thus create >>machine-unreadable documents.
Is there a reason why you are going via TIFF, instead of converting the
PDF to page images and rebuilding the PDF from them?
Yes. As I do PDF -> TIFF -> PDF to achieve the same objective, an
alternative that I have not been aware of, has stirred my interest.
I use XSLT to create LaTeX to get PDF, but I can convert a PDF to TIFF
with Imagemagick:
convert -density 600 page.pdf -resample 600x600 page.tiff
I use ghostscript because I can thus manipulate resolutions and
stuff. But with convert, I convert PDF to monochrome which
(sometimes) results in smaller PDF files, albeit converted again
from TIFF. This is because Word processors add a lot of superfluous
stuff to a PDF.
The standard tiff2pdf cannot handle the 16-bit TIFF file, but
Imagemagick can convert back to PDF. The problem is file size:
-rw-rw-r-- 1 peter peter 86774 Jul 2 22:47 page.pdf
-rw-rw-r-- 1 peter peter 278454850 Jul 2 22:55 page.tiff
-rw-rw-r-- 1 peter peter 138891446 Jul 2 23:02 newpage.pdf
Using the same conversion but omitting the resampling and creating JPG
gives much smaller file sizes:
-rw-rw-r-- 1 peter peter 86774 Jul 2 22:47 page.pdf
-rw-rw-r-- 1 peter peter 5637811 Jul 2 23:05 page.jpg
-rw-rw-r-- 1 peter peter 5635861 Jul 2 23:05 newpage.pdf
But perhaps there are other reasons for using TIFF.
I *believe* that in the beginning, I had been after something
/ lossless / but it is also possible that I had stumbled over
Ghostscript and rCo being unable to comprehend that monster rCo had
hammered together a first rCo and surprisingly runnable rCo script.
Now, the possibility to create
-) smaller
-) machine - unreadable PDF-files
has been important to me, notably when I send around files to public
services or to my Boss.
Really, I arrive at doing what I want, but I have never been able to
compare the TIFFs that FOP should be able to produce to those that I
get from Ghostscript. The procedures may be complicated (or not),
but comparing two files is too simple a task.., I should be able to
do that.
Cheerio
--
rCLI watched with glee, While your kings and queens,
fought for ten decades, For the gods they maderCY
(Sympathy for the Devil)
--- Synchronet 3.22a-Linux NewsLink 1.2