Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.continued:before makes Errors #461

Closed
moccand opened this issue Mar 22, 2020 · 6 comments
Closed

.continued:before makes Errors #461

moccand opened this issue Mar 22, 2020 · 6 comments

Comments

@moccand
Copy link

moccand commented Mar 22, 2020

juste adding this in the HTML styles :

.continued:before {
    /**
     * For repeated table headers (<thead> elements), show " - Continued"
     * before each table header repeat on subsequent (not initial) pages.
     * See https://github.com/danfickle/openhtmltopdf/pull/32
     */
    content: " - Continued";
    visibility: -fs-table-paginate-repeated-visible;
}

makes an error :

com.openhtmltopdf.load INFO:: SAX XMLReader in use (parser): com.sun.org.apache.xerces.internal.parsers.SAXParser
com.openhtmltopdf.load INFO:: SAX XMLReader in use (parser): com.sun.org.apache.xerces.internal.parsers.SAXParser
com.openhtmltopdf.load INFO:: Le type d'ÚlÚment "thead" doit se terminer par la balise de fin correspondante "</thead>".
ERROR:  'Le type d'élément "thead" doit se terminer par la balise de fin correspondante "</thead>".'
com.openhtmltopdf.exception WARNING:: Unhandled exception. Can't load the XML resource (using TRaX transformer). org.xml.sax.SAXParseException; lineNumber: 277; columnNumber: 5; Le type d'ÚlÚment "thead" doit se terminer par la balise de fin correspondante "</thead>".
com.openhtmltopdf.util.XRRuntimeException: Can't load the XML resource (using TRaX transformer). org.xml.sax.SAXParseException; lineNumber: 277; columnNumber: 5; Le type d'élément "thead" doit se terminer par la balise de fin correspondante "</thead>".
        at com.openhtmltopdf.resource.XMLResource$XMLResourceBuilder.createXMLResource(XMLResource.java:274)
        at com.openhtmltopdf.resource.XMLResource$XMLResourceBuilder.access$100(XMLResource.java:168)
        at com.openhtmltopdf.resource.XMLResource.load(XMLResource.java:81)
        at com.openhtmltopdf.pdfboxout.PdfBoxRenderer.setDocumentFromStringP(PdfBoxRenderer.java:293)
        at com.openhtmltopdf.pdfboxout.PdfBoxRenderer.<init>(PdfBoxRenderer.java:235)
        at com.openhtmltopdf.pdfboxout.PdfRendererBuilder.buildPdfRenderer(PdfRendererBuilder.java:63)
        at com.openhtmltopdf.pdfboxout.PdfRendererBuilder.run(PdfRendererBuilder.java:39)


The class is not used yet in the HTML page Tables.
I already have this style workin before addint the 'continued'

table {
   -fs-table-paginate: paginate;
}

Some of my Tables (the short and simple ones) don't have Header and Footers.
The tables that should be paginated are mostly nested ones.

@leonorader
Copy link
Contributor

@moccand Could you please share the html code?

I think the problem is not related to the PR and styles you mentioned, but simply that there is an ending missing from your html code.

@leonorader
Copy link
Contributor

@moccand
So I checked it locally and it worked for me, no exception, see the attached image (added a few more rows to that table):

image

I used openhtmltopdf version 1.0.2, which one did you use?

@moccand
Copy link
Author

moccand commented Mar 22, 2020

I also use 1.0.2

didi you uncomment this :

/* Ticket GitHub pour faire marcher ce truc
.continued:before {
content: " - Continued";
visibility: -fs-table-paginate-repeated-visible;
}
*/

@leonorader
Copy link
Contributor

Oh, now I see what happened here.
So in your question you had this:

.continued:before {
    /**
     * For repeated table headers (<thead> elements), show " - Continued"
     * before each table header repeat on subsequent (not initial) pages.
     * See https://github.com/danfickle/openhtmltopdf/pull/32
     */
    content: " - Continued";
    visibility: -fs-table-paginate-repeated-visible;
}

And this piece of code contains <thead>, so the parser complained about it.

But if you remove (as I uncommented and tried so) the comments, it is all good:

.continued:before {
    content: " - Continued";
    visibility: -fs-table-paginate-repeated-visible;
}

Will you please try?

@moccand
Copy link
Author

moccand commented Mar 22, 2020

It Works ! Thanks !

@moccand moccand closed this as completed Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants