When I add page number pagination through Javascript to my PDF, the printed version produces squares
hello. applying page number combined pdf in format of: 1/42, 2/42, 3/42 , on.
i doing through module in access , running macro run it. code below. here problem: when applied, pdf looks perfect in document view in acrobat. when print pdf out on [u]any[/u] printer, around 75% of text/numbers replaced square characters and/or hieroglyphic type characters. (mostly squares).
here's catch, when take pagination out, , pdf not have page numbers....it prints no squares. feel though script defaulting font helvetica, has custom encoding , not embed within document when character pdf produced. (if makes sense?)
is there problem script? i've used script in past. i've been told there update around month ago (when problem started occurring) on adobe's end. have duplicate scripts try out? haven't found suitable yet online. or have additions or suggestions use solve problem.
also forgot mention, must done through javascript. not through adobe's built in page number adding feature.
sub paginatepdf()
if avdoc.open(finaldlapfolder & "dlap_today.pdf", "") then
'//write js-code on variable
ex = " // set footer pageno centered " & vblf _
& " var box2width = 50 " & vblf _
& " (var p = 0; p < this.numpages; p++) " & vblf _
& " { " & vblf _
& " var arect = this.getpagebox(""crop"",p); " & vblf _
& " var totwidth = arect[2] - arect[0] " & vblf _
& " { var bstart=((totwidth/2)-(box2width/2)) " & vblf _
& " var bend=((totwidth/2)+(box2width/2)) + 5 " & vblf _
& " var fp = this.addfield(string(""xftpage""+p+1), ""text"", p, [bstart,45,bend,15]); " & vblf _
& " fp.value = ""page: "" + string(p+1)+ ""/"" + this.numpages; " & vblf _
& " fp.textsize=9; fp.readonly = true; " & vblf _
& " fp.alignment=""center""; " & vblf _
& " } " & vblf _
& " } "
'//execute js-code
aform.fields.executethisjavascript ex
end if
set finalpdf = avdoc.getpddoc
finalpdf.save pdsavecollectgarbage, finaldlapfolder & "dlap_today.pdf"
'finalpdf.save pdsavefull, finaldlapfolder & "dlap_today.pdf"
avdoc.close 1
finalpdf.close
' copy out sharepoint site
fso.copyfile finaldlapfolder & "dlap_today.pdf", publisheddlapfolder & "dlap_today.pdf"
set avdoc = nothing
set app = nothing
set finalpdf = nothing
set aform = nothing
end sub
sounds font being used add form fields not present on system.
have tried using different font?
are printing using local fonts? if turn off!
More discussions in JavaScript
adobe
Comments
Post a Comment