Jeff-Lewis / alivepdf

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

in CreatePageTree use another variable name instead of "N" because n is the current object number #95

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What is the expected output? What do you see instead?

-the pdf is broken

Original issue reported on code.google.com by dardogui...@gmail.com on 22 Dec 2008 at 7:49

GoogleCodeExporter commented 8 years ago
Hi dardoguidobono,

Can you tell me more about that ?

best,

Thibault

Original comment by thibault.imbert on 22 Dec 2008 at 9:38

GoogleCodeExporter commented 8 years ago
OK, I've just spent 3 hours on this one.....

Because you are using 'n' as a local variable in the loop, it winds up 
overwriting
'n' as the current object number.  When I was print "x of y" page numbers on my
document, any document I generated that was _less_ than 2 pages would not print
(Adobe reader shows document at 2867% and will say: "There was a problem 
reading this
document (14)").

Here is the correct code with at least two fixes:
for(var n1:int = 0; n1<nb; n1++ ) arrayPages[n1].content = findAndReplace (
aliasNbPages, nb.toString(), arrayPages[n1].content );

Steve

Original comment by spfied...@gmail.com on 1 Sep 2009 at 7:12