We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

2 issues with Aspose.Pdf.Facades.Form

1. There is an issue when using FillField with certain PDF documents (some documents work, others dont - I attached one that does not). This document used to work fine with Pdf.Kit but not with the latest version of Pdf (in the new Facades namespace). Here is the code:

var TempForm = new Aspose.Pdf.Facades.Form("c:\\in.pdf", "c:\\out.pdf");

TempForm.FillField("Product", "testvalue");

TempForm.Save();

When run with the attached PDF, the out.pdf file cannot be opened (acrobat says "There was an error processing a page. There was a problem reading this document (131)").

2. Another problem (that did not exist in the older Pdf.Kit). I need to simple list all form fields in a PDF. So I use this code:

var TempForm = new Aspose.Pdf.Facades.Form("c:\\in.pdf");
var FieldNames = TempForm.FieldNames;

The problem is that there is no "close" method and no dispose method. I need to delete the file right after this call, but is is locked until my web server closes. This did not occur in the old version ... it allowed me to delete the file right after I called .FieldNames. How do I tell the toolkit to "close" the file? Shouldn't the Form class be disposable to ensure that no files are left with an open lock?

Thanks

jay_bp:
1. There is an issue when using FillField with certain PDF documents (some documents work, others dont - I attached one that does not). This document used to work fine with Pdf.Kit but not with the latest version of Pdf (in the new Facades namespace). Here is the code:

var TempForm = new Aspose.Pdf.Facades.Form(“c:\in.pdf”, “c:\out.pdf”);

TempForm.FillField(“Product”, “testvalue”);

TempForm.Save();

When run with the attached PDF, the out.pdf file cannot be opened (acrobat says “There was an error processing a page. There was a problem reading this document (131)”).

Hi Jay,

<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
<w:UseFELayout/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–><!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}

<![endif]–>

I have tested the scenario and I am able to reproduce the same problem. For the sake of correction, I have logged it in our issue tracking system as PDFNEWNET-30982. We will investigate this issue in details and will keep you updated on the status of a correction.

We apologize for your inconvenience.

jay_bp:
2. Another problem (that did not exist in the older Pdf.Kit). I need to simple list all form fields in a PDF. So I use this code:

var TempForm = new Aspose.Pdf.Facades.Form("c:\\in.pdf");
var FieldNames = TempForm.FieldNames;

The problem is that there is no "close" method and no dispose method. I need to delete the file right after this call, but is is locked until my web server closes. This did not occur in the old version ... it allowed me to delete the file right after I called .FieldNames. How do I tell the toolkit to "close" the file? Shouldn't the Form class be disposable to ensure that no files are left with an open lock?

You can call Form class constructor with source file as the only single argument and call the save method. Then you can easily delete the source file. It will not save any other file because second argument is not passed in Form constructor.

[Csharp]

Aspose.Pdf.Facades.Form TempForm = new Aspose.Pdf.Facades.Form("D:\\PDFTEST\\in.pdf");
MessageBox.Show(TempForm.FieldNames.ToString());
TempForm.Save();

In case you have any further query, please feel free to contact. We apologize for your inconvenience.

Regarding PDFNEWNET-30982 … it looks like the problem is whenever there are fields marked as readonly in the source PDF. It looks like when it fills in these form fields, it somehow corrupts the PDF. When you edit the PDF template and remove the readonly settings on the form fields, it correctly fills the form fields and generates a good PDF.

Hi Jay,

Thanks for the information. Our development team is looking into this matter and we will definitely consider this information during the resolution of this problem. Soon you will be updated with the status of correction.

Is there any update for this issue?

Thanks

Hi Jay,

Thanks for your patience. I am pleased to share that the issue reported earlier has been fixed and its HotFix will be included in our next release version of Aspose.Pdf for .NET, which is expected to be released by early November-2011. Please be patient and spare us little time.

The issues you have found earlier (filed as 30982) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.