customize pdf css output

catherine
Posts: 45

customize pdf css output

Thu Jun 14, 2018 9:42 am

Hi,
I generate DITA to PDF WYSIWYG (pdf css). I got some problems of the PDF output.

Image Problem
In the PDF, the width of the image is larger than the width of the content area.

But if I generate DITA to PDF (Classic), the image size will automatically adjusted in the PDF file》

Can I add a code in my customized css to solve the image problem?

Localization Problem
I want to change the pdf output language to Chinese.
But I don't know how to do it.
I found that only three languages supported for the plugin "com.oxygenxml.pdf.css": de, en, fr
com.oxygenxml.pdf.css\css\core
com.oxygenxml.pdf.css\css\print

How can I add another language file, and change the language of the PDF WYSIWYG output?
Costin
Posts: 345

Re: customize pdf css output

Thu Jun 14, 2018 2:21 pm

Hello,

What type of image are you using (jpeg/bmp/png/svg)?
I just tried ta large png image and I noticed the image was automatically scaled to fit the page width. In fact, I noticed that at my side it was vice versa - while the DITA Map WYSIWYG transformation using Chemistry succesfully constrained the image's width in the resulted PDF, the DITA Map PDF output kept the large width for the the same image.

However, if, in some circumstances, the image width is too large and bleeds out of the page, you could impose a maximum width for the image, in your custom CSS (please see this page in our User-Guide that explains that).
I the parent block containing the image is rendered OK and is not too large itself, you could also try setting the max-width to 100% to force the width of the image to match the one of the parent block.

Regarding the localization problem, you can localize your output for any language (including Chinese), by manually translating the localization strings for editing and printing. The strings and their corresponding selectors are available in the "-i18n" / "p-i18n" CSS files from the to locations you already found:
com.oxygenxml.pdf.css\css\core
com.oxygenxml.pdf.css\css\print


There are more details as well as a quick example on how to create your own localization in the User-Guide.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
catherine
Posts: 45

Re: customize pdf css output

Fri Jun 15, 2018 5:57 am

Thanks so much, Costin!
You are very helpful.
My problems are solved.

Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: No registered users and 1 guest