Over a million developers have joined DZone.

Specify Character Spacing when Adding Text & Get Page Count in Saving PDF Using .NET

DZone 's Guide to

Specify Character Spacing when Adding Text & Get Page Count in Saving PDF Using .NET

· ·
Free Resource

What's New in this Release?

We are pleased to announce the release of Aspose.Pdf for .NET 10.1.0. When using the API in trial mode, you get the limitations to manipulate/add certain number of elements inside PDF file. The limitation includes adding/removing number of pages from PDF file, adding/manipulating Attachments or Annotations inside PDF file, conversion of only first 4 pages to Image format and so on. Also when using the API in trial mode (without using the license), a watermark text is added in resultant file and you also come across an error message stating that API is being used in evaluation mode. So before performing any operation, we can also check the license initialization and for this purpose, a static read-only property named IsLicensed is added in Document class. We generate the PDF files on the fly and during PDF file creation, we may come across the requirement (creating Table Of Contents etc) to get page count of PDF file without saving the file over system or stream. So in order to cater this requirement, a method ProcessParagraphs(…) has been introduced in Document class. Please take a look over following code snippet which shoes the steps to get page count without saving the document. A text can be added inside paragraphs collection of PDF file using TextFragment instance or by using TextParagraph object and even you can stamp the text inside PDF by using TextStamp class. While adding the text, we may have a requirement to specify character spacing for text object. In order to accomplish this requirement, a new property named CharacterSpacing property has been introduced. Please take a look over following approaches to fulfill this requirement. Adding text stamps inside PDF file is one of the salient features of our API and while adding Text Stamp, we may have a requirement to rotate the text stamp. In order to accomplish this requirement, a property named RotateAngle is present inside TextStamp class. You can pass any angle value which can be applied to rotate Stamp instance. Please take a look over following code snippet which illustrates the steps to rotate TextStamp at 45 degree angle when placing it inside PDF file. Recently one of the customers reported an issue where paragraph break was being added at the end of each line instead adding it at the end of paragraph. In order to cater this requirement, a new property named AddReturnToLineEnd is added in DocSaveOptions class. As well as the enhancements and features discussed above, there have been specific improvement for PDF to HTML and HTML to PDF conversion features. Among these fixes, the PCL to PDF, SVG to PDF, PDF to Excel, PDF to TIFF and TIFF to PDF conversion, conversion of PDF to PDF/A compliant documents, text replacement, rendering PDF files to XPS format are also improved. The list of important new and improved features are given below

  • Support a Method / Property to check if license is applied or not
  • Getting total number of pages in new Generator without saving Document
  • To Specify Character Spacing when adding Text in PDF
  • The Rotation enumeration should support on45 degree angle
  • Support of Arabic text filling in Textboxfield
  • PDF to DOC/DOCX: Paragraph break is added at the end of each line instead Paragraph
  • PDF to HTML - Links are converted into plain text
  • TextFragment Underline formatting is not working properly
  • PDF to HTML - Image is turned upside down in HTML
  • SVG to PDF: Image won't be inserted
  • TIFF to PDF - resultant PDF is 3 times the source
  • PDF to TIFF - Resultant image is not correct
  • PDF to PS - Resultant file size is too large
  • Text replace feature is not working with Cumulative update package 2 for SQL Server
  • PDF to HTML - Hyperlink is removed in resultant file
  • TextFragment properties malfunctioning in evaluation mode
  • Extract Text returns sometimes bad Y position
  • Sometimes corresponding charter rectangle does not give the correct position
  • HTML to PDF Characters rendering issue
  • PdfFileEditor keeps a reference to concatenated files
  • Optimizing a large PDF not releasing the memory
  • Incorrect page count being returned
  • Header/footer text is being added incorreclty
  • PDF to TIFF conversions throws StackOverflow Exception
  • PDF to HTML - Image is Rotated in resultant HTML
  • HTML to PDF - CSS float does not seem to be supported
  • HTML to PDF : More than one tbody tags in a table are not being rendered
  • Unable to get PDF Initial View Page Number
  • SVG to PDF conversion:image renders off the page
  • PCL to PDF - Shrinks page contents to left side
  • HTML to PDF: HtmlFragment throws ArgumentException
  • page-break style is not being honored during HTML to PDF conversion
  • Output generated with DOM is quite large as compared to Generator
  • ColorType property is returning wrong value
  • HTML to PDF: List Item not appearing properly
  • HTML to PDF: Text is not properly formatted.
  • PdfViewer: Printing problem with German font
  • PDF to EXCEL - Some contents are split into two cells
  • Aspose.Pdf Timeout Problem (v6.4.2)
  • Image to PDF: output PDF file is approx 6 time larger than input image
  • Search and replace text issue in evaluation mode

Other most recent bug fixes are also included in this release.

Newly added documentation pages and articles

Some new tips and articles have now been added into Aspose.Pdf for .NET documentation that may guide you briefly how to use Aspose.Pdf for performing different tasks like the followings.

Overview: Aspose.Pdf for .NET

Aspose.Pdf is a .Net Pdf component for the creation and manipulation of Pdf documents without using Adobe Acrobat. Create PDF by API, XML templates & XSL-FO files. It supports form field creation, PDF compression options, table creation & manipulation, graph objects, extensive hyperlink functionality, extended security controls, custom font handling, add or remove bookmarks; TOC; attachments & annotations; import or export PDF form data and many more. Also convert HTML, XSL-FO and MS WORD to PDF.


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}