• [Apache FOP] tiff output is blurred.

    From Michael Uplawski@michael.uplawski@uplawski.eu to comp.text.pdf,comp.text.xml on Tue Jun 16 09:31:56 2026
    From Newsgroup: comp.text.pdf

    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" ---------

    The Tiff renderer is configured like this:
    -----------
    <renderer mime="image/tiff">
    <rendering>quality</rendering>
    <anti-aliasing>true</anti-aliasing>
    <compression>NONE</compression>
    <source-resolution>600</source-resolution>
    <target-resolution>600</target-resolution>
    <!--transparent-page-background>true</transparent-page-background-->
    <!--compression>CCITT T.6</compression-->
    </renderer>
    ------------

    I am unable to manipulate the resolution of the resulting TIFF,
    text is still blurred, irrespective of my settings.
    My workaround is for the time to create PDF from FO, then to use the Ghostscript and the LIBTiff tools to transform the PDF to tiff and
    back to PDF. This way both versions of the PDF are equally readable,
    only file sizes differ.

    I would like to know if rCo once the resolution problems solved rCo fop produces smaller tiff files.

    Do you have any hints?

    Cheerio

    f'up comp.text.pdf
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Peter Flynn@peter@silmaril.ie to comp.text.pdf on Thu Jul 2 23:07:59 2026
    From Newsgroup: comp.text.pdf

    On 16/06/2026 08:31, Michael Uplawski wrote:
    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.

    Is there a reason why you are going via TIFF, instead of converting the
    PDF to page images and rebuilding the PDF from them?

    The command in question is thus:
    ----------
    fop -c ~/bin/fop-2.11/fop/conf/fop.xconf -fo "infile.fo" -tiff "/tmp/out.tif" ---------

    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.

    Peter

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Michael Uplawski@michael.uplawski@uplawski.eu to comp.text.pdf on Fri Jul 3 06:50:26 2026
    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