Good morning
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.
The command in question is thus:
----------
fop -c ~/bin/fop-2.11/fop/conf/fop.xconf -fo "infile.fo" -tiff "/tmp/out.tif" ---------
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?
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
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.
are zones where my English 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
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.
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.
I *believe* that in the beginning, I had been after something
/ lossless / but it is also possible that I had stumbled over
Ghostscript
JPG is a lossy format. Maybe if you converted to PNG, set to lossless,
that would perform better than TIFF.
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.
Because you don't want the text copied?
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 76 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 53:44:06 |
| Calls: | 1,265 |
| Calls today: | 1 |
| Files: | 1,362 |
| D/L today: |
3 files (2,684K bytes) |
| Messages: | 285,448 |