Page 1 of 1

customize pdf css output

Posted: Thu Jun 14, 2018 9:42 am
by catherine
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?

Re: customize pdf css output

Posted: Thu Jun 14, 2018 2:21 pm
by Costin
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

Re: customize pdf css output

Posted: Fri Jun 15, 2018 5:57 am
by catherine
Thanks so much, Costin!
You are very helpful.
My problems are solved.

Re: customize pdf css output

Posted: Thu Aug 09, 2018 12:07 pm
by catherine
Hi, Costin
I still have a image problem in PDF output.

If the width of the images are larger than 650px, I set the image width to 650px, in this way, when I publish webhelp, the max width of the images will be 650px.

But when I publish PDF css, the images in the PDF file do not display as what I want.
I add a sentence in my css file to restrict the max width of images in PDF file, but the image still bleed out of the page.

Code: Select all

*[class ~= "topic/image"] {
max-width: 500px;
}
If I don't set the image width to 650px in Oxygen editor, the css file also don't take effect.
I am using Oxygen XML 20.0, and the images are in png format.

Re: customize pdf css output

Posted: Thu Aug 09, 2018 4:08 pm
by Costin
Hi Catherine,

We tested this behavior using oXygen XML version 20.1 (the latest available on our website) and could not reproduce the issue.
Could you try installing the latest version, then use the predefined transformation scenario with a customization CSS that contains only the lines you tried already

Code: Select all

*[class ~= "topic/image"] {
max-width: 500px;
}
without any other rules in it and see if it works correctly?
I am suggesting this as a lot of issues are fixed and improvements are implemented from one version to the other.

If even so the issue still occurs, please send is a minimal DITA Map with just one topic containing the image that bleeds out of page on our support email (support@oxygenxml.com).

Regards,
Costin

Re: customize pdf css output

Posted: Thu Aug 16, 2018 8:20 am
by catherine
Hi, Costin
The problem of image and Chinese characters are solved under your instructions, thanks so much!

I find another problem that if I tag a step as an optional step and publish PDF css, the"Optional" word doesn't display before the step.
If I publish webhelp, it is ok.
But have problem in PDF css.

Re: customize pdf css output

Posted: Thu Aug 16, 2018 9:56 am
by Costin
Hi,

I just tested this but could not reproduce the issue.
To test, I set the importance="optional" attribute on the 2nd step of "pruning.dita" task in the "Growing Flowers" sample DITA Map in oXygen The "Optional" label is displayed just fine in the PDF. I used the default DITA Map PDF WYSIWG - based on CSS (without a customization CSS).

Are you using the latest version available (20.1)?
If you do, as this could most probably be related to your customization, to investigate further, you should send a sample task that you can reproduce the issue with and your customization css.

Regards,
Costin