Spire.PDF 3.5 starts to use new method to fill XFA Form fields

We are pleased to announce a new release version-Spire.PDF 3.5 today. With the effort of our develop team, we added many new features to enlarge Spire.PDF functions and we also offer bug solutions to the existing features offered by Spire.PDF. Viewing the following full description of its new and enhanced functions:
New features:
1. Add new method to change the highlight color.
PdfDocument pdf=new PdfDocument(inputFileName);
PdfTextFind[] result=null;
foreach(PdfPageBase page in pdf.Pages)
{
result=page.FindText("text").Finds;
foreach(PdfTextFind find in result)
{
find.ApplyHighLight(Color.Green);
}
}
2. Add new properties to apply the template when create new page.
//Create one page section.Pages.Add().AllowContainTopDocTemplates = false;
3. Add new method to fill the barcode xfa form field.
PdfDocument pdfdoc = new PdfDocument();
pdfdoc.LoadFromFile("dynamic.pdf");
PdfFormWidget form = pdfdoc.Form as PdfFormWidget;
if (form.XFAForm != null)
{
List loFields = form.XFAForm.XfaFields;
for (int i = 0; i < loFields.Count; i++)
{
if (loFields[i] is XfaBarcodeField)
{
XfaBarcodeField loBarCode = loFields[i] as XfaBarcodeField;
loBarCode.Value = "4567890123";
}
}
}
pdfdoc.SaveToFile("result.pdf");
4. Add new method to get the CMYK image from PDF.
Page.ExtracImage(bool processImage).//false returns original image in PDF.
5. Add new feature to support varying DPI settings when printing.
6. Add mediabox property in page.
Bug solutions:
- Changes the method to fill XFA Form Fields.
- Fixes the issue that caused the multiple threads unsafe.
- Fixes the issue where there is only "black" word in the result PDF when convert html to PDF.
- Fixes the issue that caused the image missing when convert Html to PDF.
- Fixes the issue where the header is being left out when printing a PDF.
- Addresses the issue where there are space characters randomly scatter throughout the text when extract text from a page.
- Resolves the issue that caused "insufficient data for an image" exception when open the merged PDF with adobe reader.
- Fixes the issue that caused the content lost when convert PDF to Image.
- Fixes the issue that caused some exceptions when convert PDF to Image.
- Fixes the issue where simply opening and saving the form to an output file results in an unusable PDF When working with XFA Forms.
- Fixes the issue that caused the x coordinates of PDF bookmarks lost.
- Fixes the issue that caused PDFA document decompression error.
- Resolves the issue that caused the values hidden until get focus after filling form fields.
- Fixes the issue where the images in PDF can't be extracted.
- Fixes the issue where Image.HorizontalResolution always returned 96dpi even image has more than that dpi.
- Fixes the issue where PDF document created with Spire.Pdf did not render properly in Firefox.
- Fixes the issue that caused PDF document unable to load.
- Resolved the issue that caused extra blank page when convert PDF to PDF/A.
- Fixes the issue where radiobuttons field added with Spire.Pdf displayed incorrectly in Adobe pro.
- Fixes the issue that caused XPS document unable to load.
- Fixes the issue that caused Pages.Insert() method not working for new page.
- Fixes the issue where this character "-" is not supported.
- Fixes the issue where text colors vanish when printing PDF.
- Fixes the issue where the fields did not respect the orientation when fill in and flatten text fields.
- Fixes the issue where document Properties in XPS were not converted to PDF.
- Fixes the issue that caused the colors gone when convert PDF to XPS.
PdfDocument pdfdoc = new PdfDocument();
pdfdoc.LoadFromFile("dynamic.pdf");
PdfFormWidget form = pdfdoc.Form as PdfFormWidget;
if (form.XFAForm != null)
{
List loFields= form.XFAForm.XfaFields;
for (int i = 0; i < loFields.Count;i++ )
{
if (loFields[i] is XfaCheckButtonField)
{ (loFields[i] as XfaCheckButtonField).Checked= true; }
if (loFields[i] is XfaTextField)
{ (loFields[i] as XfaTextField).Value="Hello"; }
//form.XFAForm[form.XFAForm.Fields[i]] = "Hello";
}
}
pdfdoc.SaveToFile("Result.pdf");
Free Trial to evaluate Spire.PDF 3.5 here:
http://www.e-iceblue.com/Download/download-pdf-for-net-now.html