XSL-fo Problem with pdf file size

I have a large number of XML documents that are created in a docbook, and through maven are published both in html for format and in pdf format. Generations work great and html looks great. The question I have is the size of the images in the pdf version. Images are a collection of screenshots, some of them are full-screen, about 2 / 3rds width and height, and others are small search boxes. Obviously, I need to do massive refactoring of imagedata attributes. I was wondering, why should I reorganize it? I am looking for a way to create up to 4 types of images and to force them to use their own size. An example image is as follows:

  <section><title>Screenshot</title>
     <mediaobject>
       <imageobject>
        <imagedata fileref="./views/screenshots/editNote.png" scalefit="0" width="100%"/>
       </imageobject>
     </mediaobject>
  </section>

And it only works for some of my screen shot sizes.

I played with scalefit, width and contentwidth / contentheight and they seem to solve different parts of the problem. Should I also look into viewports?

NOTE. There is no fear of breaking the html generation, since I can include “exclude properties” in XSL.

+3
source share
2 answers

You @scalefit="0"try to @scalefit="1":

<section><title>Screenshot</title>
     <mediaobject>
       <imageobject>
        <imagedata fileref="./views/screenshots/editNote.png" 
                   scalefit="1" width="100%" contentdept="100%"/>
       </imageobject>
     </mediaobject>
  </section>  

Here are some tips for using attribute scaling.

  • To scale the graphic to the specified width, set the width of the content in the imagedata element to this size, for example contentwidth = "8.5cm". If you specify a number without units, it is assumed to be pixels.

  • , , width = "100%" scalefit = "1" . , , .

  • , , , , , scalefit = "1", width = "100%" contentdepth = "100%" .

...

  • XSL-FO . , , . , FOP 0.20.5 , .

http://www.sagehill.net/docbookxsl/ImageSizing.html

+1

, , DPI ? HTML, docbook- > PDF.

, DPI DocBook.

+4

Source: https://habr.com/ru/post/1776573/


All Articles