Sign In  Sign Up Live-Chat

FDF IDs

Last post 08-28-2007, 11:47 AM by oxygen. 4 replies.
Sort Posts: Previous Next
  •  08-21-2007, 9:49 PM 91733

    FDF IDs

    Attachment: Present (inaccessible)

    Hello Adeel,

    I ran the code you sent me. The result was a two page doc with one page missing the fdf form fields. All I changed in your code was the path to the files and added close statements for the input streams so I could rerun this as needed. The tmp files where the input and the asdf file was the output. I also combined the files manually in acrobat to see what would happen. They combined fine even with the same ids. Any ideas?

    Thanks,

    Tim

    [Code Example 1 Using Concatenate]
    protected void Page_Load(object sender, EventArgs e)
    {
    string inFile1 = @"C:/Inetpub/wwwroot/BarcodeApp300/Tmp/tmp000463.pdf";
    string inFile2 = @"C:/Inetpub/wwwroot/BarcodeApp300/Tmp/tmp003897.pdf";
    string outFile = @"C:/Inetpub/wwwroot/BarcodeApp300/Tmp/asdf.pdf";

    FileStream inStream1 = new FileStream(inFile1, FileMode.Open);
    FileStream inStream2 = new FileStream(inFile2, FileMode.Open);
    FileStream outputStream = new FileStream(outFile, FileMode.Create);

    //Concatnate input Pdf file1 and file2, output is saved in innerStream.
    PdfFileEditor editor = new PdfFileEditor();
    editor.Concatenate(inStream1, inStream2, outputStream);

    outputStream.Close();
    inStream1.Close();
    inStream2.Close();

    }

    [Code Example 2 Using Insert ]

    public static byte[] PastePage(byte[] destPdf, byte[] srcPdf, int insertPage)
    {
    byte[] returnArray = new byte[0];
    try{

    MemoryStream srcStream = new MemoryStream(srcPdf, false);
    MemoryStream destStream = new MemoryStream(destPdf, true);
    MemoryStream tmpStream = new MemoryStream();

    PdfFileInfo pfi = new PdfFileInfo(srcStream);

    int numPgs = pfi.NumberofPages;

    int[] pgs = new int[numPgs];

    for(int i = 0; i < numPgs; i++)
    {
    pgs[i] = i+1;
    }

    PdfFileEditor pfe = new PdfFileEditor();

    pfe.Insert(srcStream, insertPage, destStream, pgs, tmpStream);

    returnArray = tmpStream.ToArray();

    srcStream.Close();
    destStream.Close();
    tmpStream.Close();
    }
    catch(Exception e)
    {
    throw e;
    }
    return returnArray;
    }




    This message was posted using Email2Forum by graves. (attachment)
     
  •  08-21-2007, 10:00 PM 91736 in reply to 91733

    Re: FDF IDs

    Hi,

    Thank you for considering Aspose.

    I have logged this issue as PDFKITNET-3629. We will investigate this issue and will let you know as soon as solution is found.

    Thanks.
     
  •  08-27-2007, 3:43 PM 92436 in reply to 91736

    Re: FDF IDs

    More info: The pdf produced from the above code has all the apropriate form fields.  However, if you open the document in Acrobat, enter the formeditor mode, and try to access the fields Adobe crashes.  (I'm using acrobat 8)

    -Tim

     
  •  08-27-2007, 8:57 PM 92464 in reply to 92436

    Re: FDF IDs

    hi, about the two problems, we have modified the code. this weekend we will release the new hotfix, you can try the new version.
    Allen Wen
    Developer
    Aspose Changsha Team

    About Us
    Contact Us
     
  •  08-28-2007, 11:47 AM 92604 in reply to 92464

    Re: FDF IDs

    Thanks Allen.  I use the fdf/forms stuff a lot so let me know if you need some good unit test samples.

    -Tim

     
View as RSS news feed in XML