Tables in PDF spanning right margin
Oxygen general issues.
-
- Posts: 12
- Joined: Fri Nov 15, 2019 9:13 pm
Tables in PDF spanning right margin
Post by AnalogKid82 »
We're using the latest DITA OT and the latest version of Oxygen Editor. Some, but not all, tables are spanning the right margin and running off the page in PDF output.
pdf_table_margin.png
Is there a global setting we can apply to all tables or is this something we need to set in XSL? The attached zip contains our XSL file, which I believe controls table behavior in PDF output. Thanks!commons-attr.zip
You do not have the required permissions to view the files attached to this post.
-
- Posts: 9436
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Tables in PDF spanning right margin
Hi,
It would have helped if you would have posted the DITA content for that table which overflows. Column spans can be defined in DITA tables either as proportional like:
or fixed like:
When you add a new table in the Author visual editing mode you can decide if the column widths should be proportional or fixed.
If they are proportional, the table should fit the page width if the processor can manage to split the contents in each cell. But if they are fixed maybe the sum of all column widths is larger than the page width.
You seem to be using the classic XSL-FO based approach to building the PDF output.
Oxygen also has the possibility to produce a PDF using our CSS-based Chemistry publishing engine.
What PDF processor are you using to produce the PDF? Is it the Apache FOP bundled with Oxygen or a commercial PDF processor like Antenna House?
In the case in which you have table cells or code blocks with long words which cannot be divided on multiple lines, the Apache FO processor has support for hyphenation:
https://www.oxygenxml.com/doc/versions/ ... ation.html
Regards,
Radu
It would have helped if you would have posted the DITA content for that table which overflows. Column spans can be defined in DITA tables either as proportional like:
Code: Select all
<colspec colname="c1" colnum="1" colwidth="1*"/>
Code: Select all
<colspec colname="c1" colnum="1" colwidth="75pt"/>
If they are proportional, the table should fit the page width if the processor can manage to split the contents in each cell. But if they are fixed maybe the sum of all column widths is larger than the page width.
You seem to be using the classic XSL-FO based approach to building the PDF output.
Oxygen also has the possibility to produce a PDF using our CSS-based Chemistry publishing engine.
What PDF processor are you using to produce the PDF? Is it the Apache FOP bundled with Oxygen or a commercial PDF processor like Antenna House?
In the case in which you have table cells or code blocks with long words which cannot be divided on multiple lines, the Apache FO processor has support for hyphenation:
https://www.oxygenxml.com/doc/versions/ ... ation.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 12
- Joined: Fri Nov 15, 2019 9:13 pm
Re: Tables in PDF spanning right margin
Post by AnalogKid82 »
Hi Radu,
Here's a sample of the table code - the colwidth clearly huge fixed values. We have several tables like this, likely caused during the conversion from HTML to DITA and writers reusing these tables instead of creating new ones with the correct colwidths. I assumed the issue was with our PDF transform. I'll go through and fix these tables to be proportional. We use the Apache FOP processor. Thanks!
Here's a sample of the table code - the colwidth clearly huge fixed values. We have several tables like this, likely caused during the conversion from HTML to DITA and writers reusing these tables instead of creating new ones with the correct colwidths. I assumed the issue was with our PDF transform. I'll go through and fix these tables to be proportional. We use the Apache FOP processor. Thanks!
Code: Select all
<table frame="all" rowsep="1" colsep="1" id="table_beginprescan">
<tgroup cols="3">
<colspec colname="c1" colnum="1" colwidth="239.25pt" align="left"/>
<colspec colname="c2" colnum="2" colwidth="76.5pt" align="left"/>
<colspec colname="c3" colnum="3" colwidth="360pt" align="left"/>
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry><codeph>app_id</codeph><p conkeyref="r_disclaimers/ckr-required"/></entry>
<entry>Integer</entry>
<entry><ph conkeyref="r_disclaimers/ckr-app_id"/></entry>
</row>
<row>
-
- Posts: 9436
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Tables in PDF spanning right margin
Hi,
Right, for conversion from fixed to proportional widths you could use an XML refactoring action.
I created a custom Oxygen XML refactoring action based on XSLT and uploaded it here:
https://github.com/oxygenxml/dita-refac ... oportional
There are instructions about how the actions can be used here:
https://github.com/oxygenxml/dita-refactoring-examples
On your sample DITA table, it converts this:
to this:
Regards,
Radu
Right, for conversion from fixed to proportional widths you could use an XML refactoring action.
I created a custom Oxygen XML refactoring action based on XSLT and uploaded it here:
https://github.com/oxygenxml/dita-refac ... oportional
There are instructions about how the actions can be used here:
https://github.com/oxygenxml/dita-refactoring-examples
On your sample DITA table, it converts this:
Code: Select all
<colspec colname="c1" colnum="1" colwidth="239.25pt" align="left"/>
<colspec colname="c2" colnum="2" colwidth="76.5pt" align="left"/>
<colspec colname="c3" colnum="3" colwidth="360pt" align="left"/>
Code: Select all
<colspec colname="c1" colnum="1" align="left" colwidth="35*"/>
<colspec colname="c2" colnum="2" align="left" colwidth="11*"/>
<colspec colname="c3" colnum="3" align="left" colwidth="53*"/>
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service