What is the encoding format of XFA in PDF file?
hello,<br /> got xfa stream in pdf file , wrote file. when processed xfa file msxml sdk, got error.in xfa file,it said default encoding utf-8.<br /> how can right xfa file msxml sdk can load it?<br /><br />thanks!<br />yun.<br /><br />here code xfa:<br />avdoc avdoc = avappgetactivedoc();<br />pddoc pddoc = avdocgetpddoc(avdoc);<br />cosdoc csdoc = pddocgetcosdoc(pddoc);<br />cosobj obj,root,xfa,preamble;<br />root = cosdocgetroot(csdoc);<br />if (cosdictknownkeystring(root,"acroform"))<br />{<br />obj = cosdictgetkeystring(root,"acroform");<br />if (cosdictknownkeystring(obj,"xfa"))<br />{<br />xfa = cosdictgetkeystring(obj,"xfa");<br />asint32 len = cosarraylength(xfa);<br />cosobj item;<br />cfile file;<br />byte head[3];<br />file.open("c:\\11.xml",cfile::modecreate|cfile::modewrite);<br />head[0] = 0xef;//for utf-8<br />head[1] = 0xbb;<br />head[2] = 0xbf;<br />file.write(head,3);<br />for (int i=0;i<len;i++)<br />{<br />item = cosarrayget(xfa,i);<br />if (cosobjgettype(item) == cosstream)<br />{<br />char *pbuff;<br />int len = 0;<br />cosreadbuffer(null,len,item);//get stream<br />pbuff = new char[len];<br />cosreadbuffer(pbuff,len,item);<br />file.write(pbuff,len);<br />delete pbuff;<br />}<br />}<br />file.close();<br />}<br />}
why writing in front of content? should extracting stream(s) raw , using - no modifications.
More discussions in Acrobat SDK
adobe
Comments
Post a Comment