Free Support Forum - aspose.com

Problem importing form data and flattenning a PDF

I'm trying to import form data into a pdf.

FDF field values are only bound to the first occurance of the fdf field.

Can this behavour be modified to bind to all occurances of a fdf field?

The pdf specification allows for this naming convension. Having multiple checkboxes with the same name but different values creates a radio button.

Attached is a pdf.

Below is the code snippet used to import the fdf.

Below that is the fdf that is imported.

The radio button I mentioned is named "TestType1".

Also, please include all responses to gravest [at] ppsc.com

Thanks,

Tim

// Export form data to pdf
outPdf = new MemoryStream();
MemoryStream fdf = new MemoryStream();
StreamWriter sw = new StreamWriter(fdf);
sw.Write(FdfIn.FDFSaveToStr());

sw.Flush();

fdf.Seek(0, SeekOrigin.Begin);

fdfout.Text = FdfIn.FDFSaveToStr();

Form form = new Form(inPdf, outPdf);

form.ImportFdf(fdf);

form.FlattenAllFields();

form.Save();

fdf.Close();

sw.Close();

inPdf = null;

inPdf = outPdf;

inPdf.Seek(0, SeekOrigin.Begin);

outPdf = null;

%FDF-1.2
%âãÏÓ
1 0 obj<</FDF<</F(http://crashy/QCPACKET/FORMS/CMN/CAREFAX/CMN_20070806C_CONCONLY.PDF)/ID[(ÚLzîn+e5MÅ1„÷¥)(ò ®S;"Fœ ÆðÏøp)]/Fields[<><><><><><><><><><><><><><><><><><><><><><><><><>]/UF(http://crashy/QCPACKET/FORMS/CMN/CAREFAX/CMN_20070806C_CONCONLY.PDF)>>>>
endobj
trailer
<>
%%EOF

Dear oxygen,

Thanks for considering Aspose.Pdf.Kit.

We have reproduced the problem. Yes, multiple CheckBoxes with the same field name acts as a radio box. This bug has been logged in our bug trace system as PDFKITNET-4944.. It is expected to solved in two weeks.

Best regards.

Dear oxygen,

This bug has been fixed. It will be published in the next release after more testing.

Best regards.

Hi,

Aspose.Pdf.Kit 3.1.0.0 is published, please download and try it.

Thanks,