Browse our Products

Aspose.PDF for .NET 9.3.0

We are pleased to share a new version of Aspose.PDF for .NET with the following improvements.

New Features

PDFNEWNET-34090 XFA document to static pdf document

PDFNEWNET-34170 Use DocumentPrivilege to set encryption in DOM Encryption

PDFNEWNET-34209 Adding Layer on existing PDF

PDFNEWNET-34390 HTML to PDF Support Javascript code

PDFNEWNET-36920 Getting PDF Hyperlink Destination (URL)

Enhancements

PDFNEWNET-30312 Printer queue document name

PDFNEWNET-31581 Identify Watermark Image from XImage collection

PDFNEWNET-34561 To remove the signature and keep signature field

PDFNEWNET-35227 Pdf file size increased after optimization

PDFNEWNET-35406 Update DocumentPrivilege class to allow Page extraction

PDFNEWNET-35766 Correct spelling mistakes in IfHtmlTagSupportedOverwrightHtmlFontNames property

PDFNEWNET-36117 PDF to HTML - Resultant images should not be SVG

PDFNEWNET-36873 PDF to HTML - Generate 3 sets of fonts to ensure maximum browser compatibility

PDFNEWNET-36915 How to break a nested table

PDFNEWNET-36943 To get submit button URL

Exceptions

PDFNEWNET-30750 Issue while converting HTML file into PDF

PDFNEWNET-33437 Exception found while converting HTML to PDF

PDFNEWNET-33585 Font source could not be opened (Exception in Pdf.Save method)

PDFNEWNET-33598 Multiple Identical Signatures in one PDF

PDFNEWNET-34092 Can not remove permissions password: Invalid Password Error

PDFNEWNET-34124 Buffered Stream usage when converting image to PDF Causes Exception.

PDFNEWNET-34199 Exceptions while trying to use PdfFileSignature Save method

PDFNEWNET-34328 Object Reference Exception is thrown on Creating Document Instance

PDFNEWNET-34420 Problem while signing the PDF document

PDFNEWNET-34652 Invalid signature object Exception is occurring when trying to read signature information

PDFNEWNET-34957 Unable to read PDF file with the Document object

PDFNEWNET-35299 NullReferenceException is occurring when trying to save the document twice

PDFNEWNET-35830 XPS to PDF - Unable to generate PDF files

PDFNEWNET-36139 HTML to PDF - NullReferenceException during conversion

PDFNEWNET-36539 Exception while using SaveResourceStrategy

PDFNEWNET-36610 PDF to XPS - Exception during conversion

PDFNEWNET-36816 Removing Image Stamp is throwing ArgumentException

PDFNEWNET-36902 Pdf Signing - Error using TimeServer

PDFNEWNET-36914 ImportDataTable method is producing InvalidCastException

PDFNEWNET-36971 Unable to remove metadata from PDF file

Bugs

PDFNEWNET-29693 Pdf Producer field is showing incorrect product version

PDFNEWNET-30979 Form field does not get filled

PDFNEWNET-31328 Unable to retrieve form field names

PDFNEWNET-32124 Unable to use Aspose.PDF for .NET when trust level for web application is defined

PDFNEWNET-32212 Margins Issue in HTML2 PDF conversion

PDFNEWNET-32413 no exception but fields wasn’t filled (PDFKITNET24265)

PDFNEWNET-32419 out file did not created (PDFKITNET25067)

PDFNEWNET-32420 System.ApplicationException : Font csr17 with style Bold was not found

PDFNEWNET-32425 output file still corrupted with 0kb of space

PDFNEWNET-32559 Convert Pdf to HTML

PDFNEWNET-33226 Add signature in PDF

PDFNEWNET-33261 New line character/carriage return is ignored when clicked inside the text field.

PDFNEWNET-33302 Extract text from PDF return garbage

PDFNEWNET-33310 PDF Portfolio is not being converted into Image format

PDFNEWNET-33352 Extract text from PDF

PDFNEWNET-33596 Application hangs during HTML to PDF conversion

PDFNEWNET-33811 Border of RadioButton is not appearing in resultant PDF

PDFNEWNET-33879 HTML to PDF - ordered list being rendered as an unordered list

PDFNEWNET-34030 PDF - Save to HTML

PDFNEWNET-34065 External CSS Issue in HTML to PDF conversion: CSS does not apply without specifying the full path

PDFNEWNET-34168 Invalid PDF/A 1b document

PDFNEWNET-34360 Problem with Document.Encrypt

PDFNEWNET-34480 Generated PDF - Summarize Comments disabled

PDFNEWNET-34538 Removing a signature field after the document is signed corrupts any remaining signature fields

PDFNEWNET-34581 Exception “Required entry is absent in annotation dictionary” is thrown on ExportAnnotationsXfdf

PDFNEWNET-34753 NotSupportedException thrown by Pdf document

PDFNEWNET-34824 PdfFileSignature(Document document) overload changes IsCoverWholeDocument() property

PDFNEWNET-34838 Added watermark should not be visible

PDFNEWNET-35129 Html to Pdf Css style is not being honored

PDFNEWNET-35160 Password protected file is throwing exception, created using Foxit PhantomPDF Printer.

PDFNEWNET-35256 Time stamp issue, while signing a document with Aspose.PDF.facdaes and Aspose.PDF.Kit

PDFNEWNET-35356 Image transparency issue on different OS

PDFNEWNET-35359 Issue in adding image using operators

PDFNEWNET-35473 Aspose Optimize function doesn’t reduce the size

PDFNEWNET-35545 PDF to TIFF conversion is throwing ArgumentException

PDFNEWNET-35552 FIPS compliance issue

PDFNEWNET-35734 Text is not properly being extracted from PDF file

PDFNEWNET-36132 PDFA_1a file is not being generated

PDFNEWNET-36359 PDF to TIFF conversion throws Exception while passing page size argument

PDFNEWNET-36395 PdfFileEditor - merging the documents loses the form fields

PDFNEWNET-36512 PDF to HTML - Performance issue when using CustomResourceSavingStrategy(B)

PDFNEWNET-36606 Incorrect data display after importing data

PDFNEWNET-36695 The newly inserted page is very small size

PDFNEWNET-36725 TXT to PDF - Conversion process does not complete

PDFNEWNET-36738 PDF to TIFF - Resultant image is blank

PDFNEWNET-36739 Extracting text from PDF file throws NullReferenceException

PDFNEWNET-36759 Submit button generates Expected a name object error

PDFNEWNET-36776 HTML to PDF renders incorrect font size

PDFNEWNET-36801 Images are not being recognized in PDF file

PDFNEWNET-36803 PDF to TIFF - Checkbox value is not being retained in TIFF

PDFNEWNET-36808 FreeTextAnnotation: setting background to Transparent doesnot work

PDFNEWNET-36824 PDF to PDF/A_1b conversion fails

PDFNEWNET-36834 HTML to PDF - CSS is not being referenced

PDFNEWNET-36836 Extracting Annotation image appears as black rectangle

PDFNEWNET-36837 PDF to JPEG - Annotations are not appearing on resultant files

PDFNEWNET-36870 PDF to HTML Fidelity Issue

PDFNEWNET-36875 Document object throwing OverflowException

PDFNEWNET-36881 Unable to get exact text using coordinates

PDFNEWNET-36889 HTML to PDF - Unable to update Page dimensions

PDFNEWNET-36931 Insert page - First page is blank in resultant file

Public API and Backwards Incompatible Changes

  • UnembedFonts property was introduced to OptimizationOptions class. If the property is set to true - the fonts become not embedded.
 Document doc = new Document("input.htm");

Document.OptimizationOptions opt = new Document.OptimizationOptions();

opt.UnembedFonts = true;doc.OptimizeResources(opt);

doc.Save("output.pdf");
  • CompressImages and ImageQuality properties were introduced to OptimizationOptions class.
    • If CompressImages set to true all images in the document will be recompressed and compression is defined by ImageQuality property which is value of quality in percent. 100% is unchanged quality and image size. To decrease image size use ImageQuality < 100. 
 Document doc = new  Document("input.htm");

Document.OptimizationOptions opt = new Document.OptimizationOptions();

opt.RemoveUnusedObjects = false;

opt.LinkDuplcateStreams = false;

opt.RemoveUnusedStreams = false;

opt.CompressImages = true;

opt.ImageQuality = 10;

doc.OptimizeResources(opt);

doc.Save("output.pdf");
  • InputEncoding option was introduced into HtmlLoadOptions class
    • The InputEncoding may be set to explicitly set the encoding of the document.
 HtmlLoadOptions options = new HtmlLoadOptions();

options.InputEncoding = "windows-1252";

Document doc = new Document("input.htm", options);

doc.Save("output.pdf");
  • Option LettersPositioningMethod has been introduced into HtmlSaveOptions.
  • Enumeration LettersPositioningMethods was introduced into Aspose.PDF namespace.the enumeration provides the following values:
    • UseEmUnitsAndCompensationOfRoundingErrorsInCss

It’s the default method. It uses EM-units and special algorithms of compensation for rounding errors. It’s preferable for usage in IE10.0 and more fresh versions and gives better scaling of captions when scaling is necessary    UsePixelUnitsInCssLetterSpacingForIE. It allows to get sometimes more precise results in old IE browser versions. Following code snippet demonstrates how to optimize letter positioning in old IE browsers.

 Document pdfDocument = new Document(@"input.pdf");

HtmlSaveOptions saveOptions = new HtmlSaveOptions(HtmlDocumentType.Xhtml);

// checked settingsaveOptions.LettersPositioningMethod = HtmlSaveOptions.LettersPositioningMethods.UsePixelUnitsInCssLetterSpacingForIE;

pdfDocument.Save(@"output.html", saveOptions );

SaveInAllFormats font saving mode was introduced in HtmlSaveOptions.FontSavingModes enumeration.

Following code snippet demonstrates how to generate 3 sets of fonts (EOT, WOFF,TTF):

 Document doc = new Document("input.pdf");

HtmlSaveOptions htmlOptions = new HtmlSaveOptions();

htmlOptions.FixedLayout = true;

htmlOptions.RasterImagesSavingMode = HtmlSaveOptions.RasterImagesSavingModes.AsExternalPngFilesReferencedViaSvg;

htmlOptions.FontSavingMode = HtmlSaveOptions.FontSavingModes.SaveInAllFormats;

doc.Save("output.html", htmlOptions);

Star values were added into Aspose.PDF.InteractiveFeatures.Annotations.TextIcon.TextIcon enumeration:

Cross

  • Cross icon.Circle
  • Circle icon.Star
  • Star icon.

The code demonstrates how to use new icons in TextAnnotation:

 TextAnnotation ta = new TextAnnotation(page, new Rectangle(100, y - size, 100 + size, y));

ta.Icon = TextIcon.Star;page.Annotations.Add(ta);
  • Layer class was introduced

The Layer class contains the following properties:

  • Name
  • Layer NameId
  • layer IdContents
  • layer operators listLayers

collection was added to Page class

Following code snippet demonstrates how to add layers to Pdf document:

 Document doc = new Document();

Page page = doc.Pages.Add();

Layer layer = new Layer("oc1", "Red Line");

layer.Contents.Add(new Operator.SetRGBColorStroke(1, 0, 0));

layer.Contents.Add(new Operator.MoveTo(500, 700));

layer.Contents.Add(new Operator.LineTo(400, 700));

layer.Contents.Add(new Operator.Stroke());

page.Layers = new ArrayList();

page.Layers.Add(layer);

layer = new Layer("oc2", "Green Line");

layer.Contents.Add(new Operator.SetRGBColorStroke(0, 1, 0));

layer.Contents.Add(new Operator.MoveTo(500, 750));

layer.Contents.Add(new Operator.LineTo(400, 750));

layer.Contents.Add(new Operator.Stroke());

page.Layers.Add(layer);

layer = new Layer("oc3", "Blue Line");

layer.Contents.Add(new Operator.SetRGBColorStroke(0, 0, 1));

layer.Contents.Add(new Operator.MoveTo(500, 800));

layer.Contents.Add(new Operator.LineTo(400, 800));

layer.Contents.Add(new Operator.Stroke());page.Layers.Add(layer);

doc.Save("output .pdf");