You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a specific structure in my source html, file attached (pdf.html.txt), that somehow creates a trailing whitespace when using text-align: right and the text is using more than one line.
When I use that html in my implementation like in the attached example.java.txt, it will add a trailing whitespace. Shown in the wrongOutput.pdf.
When I copy the html into your line-wrap-pre-wrap test case html and run the testLineWrapPreWrap() in TextVisualRegressionTest.java it works perfectly fine, also attached. Is there anything I am doing wrong in the preprocessing of the html or the implementation?
I figured out, that some html is not accepted in your test cases, like a normal tag, while I dont get an error using something like that in my implementation.
There is a fix for this issue, which I guess could be noted somewhere:
In your test cases you are using a different TextBreaker:
SimpleTextBreaker implements FSTextBreaker
So what I did is copying the class from the test into my project and use it like this:
`byte[] pdf;
try {
os = new ByteArrayOutputStream();
builder.toStream(os);
builder.useFastMode();
builder.useSVGDrawer(new BatikSVGDrawer());
builder.useUnicodeLineBreaker(new SimpleTextBreaker());
builder.run();
pdf = os.toByteArray();
os.close();
os = null;`
It is important to have the SimpleTextBreaker after the SVGDrawer, otherwise its not rendering imported PDFs.
Thank you for the effort and fixing this issue!
Any plans for a new release with the fix any time soon?
The solution with the SimpleTextBreaker won't work for japanese, as there are no whitespaces and any text is rendered in one line. But with your fix I can use the standard linebreaker again, which will solve the japanese problem as well.
I am experiencing the following problem:
I have a specific structure in my source html, file attached (pdf.html.txt), that somehow creates a trailing whitespace when using text-align: right and the text is using more than one line.
When I use that html in my implementation like in the attached example.java.txt, it will add a trailing whitespace. Shown in the wrongOutput.pdf.
When I copy the html into your line-wrap-pre-wrap test case html and run the testLineWrapPreWrap() in TextVisualRegressionTest.java it works perfectly fine, also attached. Is there anything I am doing wrong in the preprocessing of the html or the implementation?
I figured out, that some html is not accepted in your test cases, like a normal
tag, while I dont get an error using something like that in my implementation.
Attachments:
example.java.txt
pdf.html.txt
line-wrap-pre-wrap---actual.pdf
wrongOutput.pdf
The text was updated successfully, but these errors were encountered: