What is the encoding format of XFA in PDF file?

Ask a Question related to Adobe Acrobat SDK, Design and Development.

  1. #1

    Default What is the encoding format of XFA in PDF file?

    Hello,
    I got the XFA stream in PDF file and wrote it into a file. When I processed the XFA file with MSXML SDK, I got an error.In the XFA file,it is said the default encoding is UTF-8.
    How can I get the right XFA file that MSXML SDK can load it?

    Thanks!
    Yun.

    Here is the code I get the XFA:
    AVDoc avDoc = AVAppGetActiveDoc();
    PDDoc pdDoc = AVDocGetPDDoc(avDoc);
    CosDoc csDoc = PDDocGetCosDoc(pdDoc);
    CosObj obj,root,XFA,preamble;
    root = CosDocGetRoot(csDoc);
    if (CosDictKnownKeyString(root,"AcroForm"))
    {
    obj = CosDictGetKeyString(root,"AcroForm");
    if (CosDictKnownKeyString(obj,"XFA"))
    {
    XFA = CosDictGetKeyString(obj,"XFA");
    ASInt32 len = CosArrayLength(XFA);
    CosObj item;
    CFile file;
    byte head[3];
    file.Open("c:\\11.xml",CFile::modeCreate|CFile::mo deWrite);
    head[0] = 0xEF;//for UTF-8
    head[1] = 0xBB;
    head[2] = 0xBF;
    file.Write(head,3);
    for (int i=0;i<len;i++) { item = CosArrayGet(XFA,i); if (CosObjGetType(item) == CosStream) { char *pbuff; int len = 0; CosReadBuffer(NULL,len,item);//get something from stream pbuff = new char[len]; CosReadBuffer(pbuff,len,item); file.Write(pbuff,len); delete pbuff; } } file.Close(); } }
    yiyun0918@adobeforums.com Guest

  2. Similar Questions and Discussions

    1. File encoding, UTF-8 troubles in XML docs
      :confused; Our site includes several large archives of XML documents which we display as HTML using XMLtransform. We have some very bizarre...
    2. Problem with default Java File Encoding
      I have a problem with Coldfusion JAVA encoding. The page on the server is encoded with UTF-8. Windows 2003 Server is running on the machine. English...
    3. File Viewer / Bloated file sizes / What is the best file format?
      I would like to find a viewer capable of looking at the main Adobe formats as well as the standard formats such as JPG and WMF ... but yet the only...
    4. [newbie] specifying file encoding
      i have a very simple script in ISO-8859-1 : #!/usr/bin/ruby w = "émilion" fo = File.open("capitalize.txt", File::RDWR|File::CREAT,0600) fo.puts...
    5. Encoding problem (french character) in txt file on Mac OS X
      Hi, I've tried several things but I can't get out of this issue ! I have this meta-tag in my header : <meta http-equiv="Content-Type"...
  3. #2

    Default Re: What is the encoding format of XFA in PDF file?

    Why are you writing anything in front of the content? you should just be extracting the stream(s) raw and using it - NO modifications.
    Leonard_Rosenthol@adobeforums.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139