yyn0210 / alivepdf

Automatically exported from code.google.com/p/alivepdf
0 stars 0 forks source link

writeFlashHtmlText puts in too many page breaks #216

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Pass writeFlashHtmlText two pages of text containing lots of short lines
ending in <br/>, not large blocks of text.

What is the expected output? What do you see instead?
I expect a two page PDF file.

Instead I get a decent first page, and then subsequent pages have only a
single line of text at the top of each page.

What version of the product are you using? On what operating system?
1.5 RC, WinXP

Please provide any additional information below.

It seems that several short lines with <BR/> on the end are sent to the
renderLine function all at once. In that function, only a single check is
made for a page break.

Forcing renderLine to be called when a <br/> is found fixes this :

In the file PDF.as, changing the switch statement in function
writeFlashHtmlText at line 2855 from

case "</BR>":

to

case "</BR>":
if (currentLine.length > 0 ) {
  renderLine(currentLine,textAlign);
  currentX  = leftMargin;
  currentLine = new Array();
}
break;

Original issue reported on code.google.com by geoff.au...@gmail.com on 2 Apr 2010 at 2:33

GoogleCodeExporter commented 9 years ago
Thanks for the bug, this will be fixed in the next drop!

best,

Thibault

Original comment by thibault.imbert on 2 Apr 2010 at 6:36

GoogleCodeExporter commented 9 years ago
Thanks, this fix works.

Original comment by nuno...@gmail.com on 24 May 2010 at 6:02

GoogleCodeExporter commented 9 years ago
Hi sensei,

Thanks for the fix, finally committed in revision 271. Sorry for the delay.

best,

Thibault

Original comment by thibault.imbert on 25 May 2010 at 8:53

GoogleCodeExporter commented 9 years ago
Hey, my first open source submission has been accepted! I've never had the time 
to
work on a big OSS project, but I've made use of a lot over the years so it's 
nice to
help make it a little better for everyone else. Thanks for the great work guys.

Original comment by geoff.au...@gmail.com on 26 May 2010 at 6:46

GoogleCodeExporter commented 9 years ago
fixed in r271 as stated above. I close the issue.

Original comment by felix.ge...@gmail.com on 8 Oct 2011 at 5:25