Examples of Aspose.Words Code Comparisons with Apache POI WP Integrates with NetBeans IDE

Aspose Java for NetBeans – Aspose Project Wizard v2.3 released!

Aspose released its NetBeans IDE plugin – Aspose Project Wizard v2.3 integrating examples of Aspose.Words for Java code and features comparison with Apache POI WP.

With this integration you now don’t need to manually download the Aspose Java APIs code comparison examples with Apache POI framework as they are now available through the plugin’s Aspose New Example wizard within NetBeans IDE with the absolute ease.

Comparison examples shows side by side code comparison for features available in both Aspose.Words and Apache POI-HWPF & POI-XWPF and further highlighting many features that are only available in Aspose Java APIs.

How to create Aspose.Words features Comparison example with Apache POI within NetBeans

  1. Create Aspose Application using Aspose Project Wizard (detailed steps are mentioned in previous Aspose blog post), on wizard select Aspose.Words component like shown in below snap shot: SxcyqwZ Examples of Aspose.Words Code Comparisons with Apache POI WP Integrates with NetBeans IDE
  2. Create new Aspose example from the New File option in NetBeans (detailed steps are mentioned in previous Aspose blog post).
  3. Select Aspose.Words component from the selection box, then examples will get downloaded and appear in tree format including Aspose.Words code comparison examples with Apache POI WP as shown in below snapshot:nve3YAb Examples of Aspose.Words Code Comparisons with Apache POI WP Integrates with NetBeans IDE
  4. Select example and click on Finish: MXaEfos Examples of Aspose.Words Code Comparisons with Apache POI WP Integrates with NetBeans IDE That will start downloading the selected example dependencies i.e Apache POI framework library jars.
  5. After dependencies download, selected example will become available in your Aspose application within src folder along with Apache POI framework jars dependencies as below:X8w1H04 Examples of Aspose.Words Code Comparisons with Apache POI WP Integrates with NetBeans IDE

Recommended Links

Source Code Available

Aspose Project Wizard for NetBeans is open source and its source code is available on below mentioned major social coding websites. Developers can extend the functionality if they want or learn from it to make their own plugins.

GitHub Mark icon2 Examples of Aspose.Words Code Comparisons with Apache POI WP Integrates with NetBeans IDE GitHub

sourceforge icon2 Examples of Aspose.Words Code Comparisons with Apache POI WP Integrates with NetBeans IDE SourceForge

bitbucket icon3 Examples of Aspose.Words Code Comparisons with Apache POI WP Integrates with NetBeans IDE Bitbucket

codeplex icon2 Examples of Aspose.Words Code Comparisons with Apache POI WP Integrates with NetBeans IDE CodePlex

Posted in Aspose.Total Product Family | Leave a comment

Aspose.Words for Java – Comparison for Features and Usage with Docx4j

aspose words for java Aspose.Words for Java   Comparison for Features and Usage with Docx4jdocx4j Aspose.Words for Java   Comparison for Features and Usage with Docx4jThe project Aspose Java for Docx4j shows how different tasks can be performed using Aspose for Java APIs in comparison with Docx4j. The project also covers the features that are only available in Aspose’s APIs but not in Docx4j for Microsoft Word and Open Office documents.

Some of the examples are available to download download s1 Aspose.Words for Java   Comparison for Features and Usage with Docx4j and to give you a better idea of how the API works, many more detailed examples are available at Aspose Docs.

Examples: Aspose.Words vs Docx4j

Below are some examples that compare code, side by side, for features available in both Aspose.Words and Docx4j.

Working with Document

Working with Bookmarks

Source code of these examples is freely hosted on popular social coding sites like CodePlexGitHubBitbucket and SourceForge.

Examples: Features of Aspose.Words missing in Docx4j

There are many Microsoft Words and OpenOffice features that are only available in Aspose API but not in Docx4j. Below are some of these examples and source code is also available on CodePlexGitHubBitbucket and SourceForge.

Working with Documents

Working with Tables

Mail Merge

Feedback and Suggestions

Posted in Aspose.Total Product Family, Aspose.Words Product Family | Leave a comment

Removal of ICE_JNIRegistry.dll Dependency and Other Rendering Improvements with Aspose.Diagram for Java 3.0.0

aspose diagram for java e1401178596961 Removal of ICE JNIRegistry.dll Dependency and Other Rendering Improvements with Aspose.Diagram for Java 3.0.0We’re pleased to announce the release of Aspose.Diagram for Java 3.0.0. With this release, we have removed the dependency on the ICE_JNIRegistry.dll library. We used the library to load font information on Windows systems only. We have removed it to increase consistency and simplicity for developers. This release also improves rendering features by fixing error messages, bugs and including advanced techniques of enhancements.

Removal of ICE_JNIRegistry.dll Dependency

Previously, in the Aspose.Diagram for Java API, JNI was used to load font information on Windows systems. It was not compatible with Java Development Kit 7. We received a few requests from our customers to remove this dependency and are pleased to tell our customers that we have.

Error Message Fixes and Other Rendering Improvements

This new release delivers improvements in rendering of properties, missing shapes, incorrect layouts and displacements of shapes. This release comprises a number of key fixes that help us improve rendering. This version also brings fixes to reported error messages and include various other enhancements as listed below:

  • Fixed: Action cells were not properly preview able in the Microsoft Office Visio 2013.
  • Fixed: Shape cut off when saving to VDX format.
  • Fixed: VSDX to PDF conversion – Adobe Acrobat error when opening PDF.
  • Fixed: VSDX to PDF conversion – shapes missing from the output PDF.
  • Fixed: VSDX to PNG conversion – horizontal lines missing from the output PNG.
  • Fixed: VSDX to PNG conversion – circular shapes missing from the output PNG.
  • Fixed: VTX to PDF conversion – null pointer exception when saving to PDF.
  • Fixed: Shape properties not added properly.

Aspose.Diagram for Java Resources

The following resources will help you work with Aspose.Diagram for Java:

We hope you’ll enjoy this new release that save time and efforts. The API is quite simple and developers can use it in application easily.

Posted in Aspose for Java APIs, Aspose.Diagram Product Family, Aspose.Total Product Family, Imran.Rafique | 1 Comment

Unit Tests for Aspose.Pdf APIs Added to Aspose for Cloud Android SDK

aspose pdf for cloud 140px e1393511150928 Unit Tests for Aspose.Pdf APIs Added to Aspose for Cloud Android SDKAspose.Pdf for Cloud is a REST API for creating and editing PDF files. It can also be used to convert PDF files to different formats like DOC, HTML, XPS, TIFF and many more. Aspose.Pdf for Cloud gives you control: create PDFs from scratch or from HTML, XML, template, database, XPS or an image. Render PDFs to image formats such as JPEG, PNG, GIF, BMP, TIFF and many others. Aspose.Pdf for Cloud helps you manipulate elements of a PDF file like text, annotations, watermarks, signatures, bookmarks, stamps and so on. Its REST API also allows you to manage PDF pages by using features like merging, splitting, and inserting. Add images to a PDF file or convert PDF pages to images.

Build and Run Aspose.Pdf Unit Tests

  1. Download Aspose for Cloud Android SDK from GitHub and extract the ZIP file.
  2. Import the SDK into Eclipse
  3. Connect an Android device to your machine. On the device or emulator, open the Settings menu, select Developer options and make sure that USB debugging is enabled.
  4. In the Project Explorer, right-click on the test class that you want to test and select Run As, followed by Android Junit Test.
  5. In the Android Device Chooser dialog, select the device that you just connected, then click OK.
  6. In the JUnit view, verify that the test passes with no errors or failures.

Start a Free Trial Today

Start a free trial today – all you need is to sign up with the Aspose for Cloud service. Once you have signed up, you are ready to try the powerful file processing features offered by Aspose for Cloud.

Customer Feedback

Your feedback is very important to us. Please feel free to provide feedback and raise feature requirements. We are keen to implement customer driven features since we are a 100% customer driven company.

Posted in Aspose for Cloud APIs | Leave a comment

Manipulate Images Using the Aspose for Cloud Python SDK

Introduction to Python

python logo master v3 TM1 300x101 Manipulate Images Using the Aspose for Cloud Python SDKPython is a programming language that lets you work more quickly and integrate your systems more effectively. You can learn to use Python and see almost immediate gains in productivity and lower maintenance costs. Python can be easy to pick up whether you’re a first time programmer or you’re experienced with other languages. The community hosts conferences and meetups, collaborates on code, and much more. Read more about Python.

Aspose for Cloud

aspose logo 1 300x81 Manipulate Images Using the Aspose for Cloud Python SDKAspose for Cloud is a cloud-based document generation, conversion and automation platform for developers. Before Aspose for Cloud APIs document processing and manipulation tasks were not so easy. Aspose for Cloud APIs give developers full control over documents and file formats. Each API has been developed to offer you a wide range of features for file processing in cloud. Aspose for Cloud REST APIs are platform independent and can be utilized across any platform such as Amazon, Salesforce etc. without any installation. Being language independent makes it a suitable choice for the developers having expertise in any programming language. We also provide SDKs in different programming languages such as .NET, Java, PHP, Ruby, Node.js and Python.

Aspose.Imaging for Cloud

aspose imaging for cloud 100px Manipulate Images Using the Aspose for Cloud Python SDKAspose.Imaging for Cloud lets you use a REST API to inspect, convert, and transform images on the cloud. It currently supports the most popular image formats such as PSD, PNG, GIF, BMP, TIFF, JPEG and their interconversion. Aspose.Imaging for Cloud also provides a rich set of features to manipulate the images on-the-fly with cloud based image transformations. You can resize, crop and/or rotate the images in various ways by just creating a request that includes the correct transformation instructions. The most demanding imaging routines such as TIFF concatenation, and image conversion to fax compatible format are available through efficient and reliable specialized resources. You can perform these operations without needing to know what’s going on under the hood so that you can focus on the core business goals.

Download

Start a Free Trial Today

Start a free trial today – all you need is to sign up with Aspose for Cloud service. Once you have signed up, you are ready to try powerful file processing features offered by Aspose for Cloud.

Posted in Aspose SDKs, Aspose for Cloud APIs, Aspose.Total Product Family | Leave a comment

Unit Tests for Aspose.Slides APIs Added to Aspose for Cloud Android SDK

Aspose.Slides for Cloud

aspose Slides for CloudAPIs 100 Unit Tests for Aspose.Slides APIs Added to Aspose for Cloud Android SDKAspose.Slides for Cloud is a REST API which allows you to process presentations. It allows you to create, modify, and convert presentations and provides a wide variety of features for working with presentations in the cloud. You can convert a presentation to TIFF, PDF, XPS, PPTX, ODP, PPSX, PPTM, PPSM, POTX, POTM, HTML and image formats. Aspose.Slides for Cloud allows you to extract different elements or a presentation including slide, text, color schemes, font schemes, shapes and images etc. Aspose.Slides for Cloud’s powerful API lets your apps process Microsoft PowerPoint presentations in the cloud, saving you the time it would take to develop your own API.

Build and Run Aspose.Slides Unit Tests

  1. Download Aspose for Cloud Android SDK from GitHub and extract the ZIP file.
  2. Import the SDK into Eclipse
  3. Connect an Android device to your machine. On the device or emulator, open the Settings menu, select Developer options and make sure that USB debugging is enabled.
  4. In the Project Explorer, right-click on the test class that you want to test and select Run As, followed by Android Junit Test.
  5. In the Android Device Chooser dialog, select the device that you just connected, then click OK.
  6. In the JUnit view, verify that the test passes with no errors or failures.

Start a Free Trial Today

Start a free trial today – all you need is to sign up with the Aspose for Cloud service. Once you have signed up, you are ready to try the powerful file processing features offered by Aspose for Cloud.

Customer Feedback

Your feedback is very important to us. Please feel free to provide feedback and raise feature requirements. We are keen to implement customer driven features since we are a 100% customer driven company.

Posted in Aspose for Cloud APIs, Aspose.Total Product Family | Tagged , , | Leave a comment

Enhanced Export of Visio Files and Correct Position of Shapes using Aspose.Diagram for .NET 4.5.0

aspose Diagram for net 100 Enhanced Export of Visio Files and Correct Position of Shapes using Aspose.Diagram for .NET 4.5.0We have released the new version of Aspose.Diagram for .NET 4.5.0. Our releases are typically based on customer feedback about the operational features of the API. This release brings a number of fixes and enhancements that also improve performance of the API. A connection point on a shape can be used to connect with other shapes. After the manipulation of a Visio shapes, we were not able to move sub shapes along with connection points. It is now fixed. Similarly, there is a list of other defects, those we have fixed in this release.

Plotting Visio Drawings within the Actual Scale

The problem was that a few customers reported Visio file samples which they exported to PDF or thumbnail formats. The API was bringing whitespace under or besides the actual figure. In this release, we have fixed most of these type of issues.

Removal of Additional Shapes

During the export of Visio files to PDF or HTML formats, the Aspose.Diagram API was placing a few additional shapes like moustache, half circle and half circle with black color fill. It was the case with few sample Visio drawings. There was no presence of these shapes in the source Visio drawings.

Error Message Fixes

This new version brings fixes to reported error messages and include various other enhancements. Please see the complete list of fixed error messages in the new version.

  • Fixed: Error in elements when loading VSD drawing

  • Fixed: ArgumenetException when saving to the JPG format after SetWidth method call

  • Fixed: Input string format error when converting VDX drawing in PDF format

  • Fixed: Error in element VisioDocument when loading a VSD diagram

This release also increases the layout perfections when rendering the Visio diagram to various other supported formats. These perfections were fruitful in calculating the accurate height / width of the page or shape of the Visio drawings. There have been a few numbers of defects  already reported. Please see other resolved problems below:

  • Fixed: Action cell is not properly preview able in the MS Office Visio 2013

  • Fixed: The shape’s properties are not being added properly

  • Fixed: VSD to PDF conversion, incorrect page number sequence

  • Fixed: The shape is cut off when saving to the VDX format

To view a complete list of API features and try the API at your end, please visit the following page and download the latest version of Aspose.Diagram for .NET. If you need any help, please feel free to ask in the Aspose.Diagram forum. For more details, please visit the Aspose.Diagram for .NET documentation.

Posted in Aspose for .NET APIs, Aspose.Diagram Product Family, Imran.Rafique | Leave a comment

Insert text, Move pages & Append PDFs using HTML5 PDF Editor by Aspose for .NET v2.0

aspose Pdf for net 100 Insert text, Move pages & Append PDFs using HTML5 PDF Editor by Aspose for .NET v2.0New version of our HTML5 PDF Editor has been released with more enhancements and attractive features. New features allow the users to insert text, append PDF files, move pages in PDF file and repositioning of the inserted contents. The backend of the editor is powered by Aspose.Pdf for .NET which is very feature rich API when it comes to creating and editing PDF files and the results are precise.

Newly Supported Features

Some attractive features are supported in this release of HTML5 PDF Editor which are as follows:

  • Append PDF Files.
  • Move Pages in PDF file.
  • Insert formatted text in a PDF file.
  • Drag and Re-position inserted contents in PDF file.
  • Export the updated PDF file.

Following is the screenshot of the latest Html5 PDF Editor:

text drag Insert text, Move pages & Append PDFs using HTML5 PDF Editor by Aspose for .NET v2.0

Download the HTML5 PDF Editor and  edit your PDF files. We will soon include more features in our upcoming releases.

Check out the detailed article here >>

Source Code Available

The application source code is available for developers to download and use at their end. Developers can use the sample application and further enhance it with more features as per their requirements.

microsoft1 Insert text, Move pages & Append PDFs using HTML5 PDF Editor by Aspose for .NET v2.0 Code.msdn.microsoft.com

codeplex icon2 Insert text, Move pages & Append PDFs using HTML5 PDF Editor by Aspose for .NET v2.0 CodePlex

Posted in Aspose.Pdf Product Family, Aspose.Total Product Family, Nausherwan Aslam | Tagged , , , , , , , , | 1 Comment

Detect Text Blocks with Aspose.OCR for .NET 2.1.0

aspose OCR for net 100 Detect Text Blocks with Aspose.OCR for .NET 2.1.0We are pleased to announce that the Aspose.OCR for .NET 2.1.0 is now available for public use. While you are downloading the latest build, here is a look at the most worth mentioning features in this month’s release. For a full list of bug fixes and improvements please refer to the release notes of Aspose.OCR for .NET 2.1.0, and if you are planning to upgrade the API from any previous version, we would suggest you to check the Public API Changes section.

Introduction to IRecognizedPartInfo

Aspose.OCR for .NET API has exposed IRecognizedPartInfo to keep track of all the recognized blocks on the image that could be text or detected picture block. Textual blocks are represented by IRecognizedTextPartInfo holding useful information about the recognized text part. Each part has its own style, font, text size, color, language and other attributes. If the text consists of several parts that are written in different font styles or even in different languages then IRecognizedTextPartInfo will hold an item representing individual element.

Detect Text Blocks on Image

Recognized Text blocks can be retrieved using the OcrEngine.Text property only after performing the OCR operation. These blocks are stored as an array of IRecognizedPartInfo and contains information as discussed above along with the position and size of the block on the image. The IRecognizedPartInfo.Box property can be used to get the rectangular area where the detected block (with text or picture) is shown on the image. The Box property returns the coordinates starting from the upper left corner of the image.

Below provided code snippet demonstrates the usage of Aspose.OCR for .NET API to retrieve the additional information from each recognized block.


// Initialize OcrEngine
OcrEngine engine = new OcrEngine();

// Load Image
engine.Image = ImageStream.FromFile(imageFile);

// Remove non-textual blocks
engine.Config.RemoveNonText = true;

// Load the resource file
using (engine.Resource = new FileStream(resourceFileName, FileMode.Open))
{
    try
    {
        // Process the whole image
        if (engine.Process())
        {
            //Display text block locations
            Console.WriteLine(engine.Text.PartsInfo[0].Box);
            Console.WriteLine(engine.Text.PartsInfo[1].Box);
        }
    }
    catch (Exception ex)
    {
        Console.WriteLine("Exception: " + ex.Message);
    }
}

Enhancements to the OcrEngine

Last but not the least, we have made some improvements to the OcrEngine for performance considerations and accuracy. Moreover, we have fixed a few problem regarding the recognition of numbers, and cases that may cause OutOfMemory & IndexOutOfRange exceptions.

As always we appreciate your feedback so if you ever have anything to tell us about this release or anything else, please head to the Aspose.OCR forum for a chat.

Posted in Aspose for .NET APIs, Aspose.OCR Product Family, Babar Raza | 1 Comment

PDF to PDF/A-2A Conversion, Set Output File Dimensions, Create Link to Already Attached Files with Aspose.Pdf for .NET 9.7.0

aspose Pdf for net 100 PDF to PDF/A 2A Conversion, Set Output File Dimensions, Create Link to Already Attached Files with Aspose.Pdf for .NET 9.7.0 We are very much excited to announce the release of Aspose.Pdf for .NET 9.7.0 which provides several great new features/enhancements and fixes for issues reported in earlier versions. Every new release is more powerful, reliable and performance optimized compared to previous versions. To benefit the latest features, we always encourage our customers to migrate to the latest release.

Create Internal Link to Already Attached Files

Aspose.Pdf for .NET supports the feature to add/update attachments inside PDF documents. It also offers the feature to create link annotations inside PDF files. The link can point to a page within the document, any other file placed on the system, a JavaScript link or some web location. However, the latest release also enables developers to create links to attachments already in the PDF file. For further information, please visit Add Hyperlink to Open Attachments in PDF.

// Load PDF document
Document doc = new Document("c:/pdftest/output_attach.pdf");
// Create attachment annoation
FileAttachmentAnnotation fileAttachment = new FileAttachmentAnnotation(doc.Pages[1], new Aspose.Pdf.Rectangle(0, 0, 16, 16), doc.EmbeddedFiles[1]);
// Add attachment to first page of PDF
doc.Pages[1].Annotations.Add(fileAttachment);
// Set title for attachment
fileAttachment.Title = "Attached file";
// Save the PDF file
doc.Save("c:/pdftest/Attachmentlink.pdf");

PDF to HTML – Set Output File Size (Dimensions)

HTML to PDF and PDF to HTML conversion are some of the main features that the development team are working to improve and in recent releases, we have made significant improvement to them. In the current release, we offer the new capability to set the output file dimensions when converting a PDF file to HTML format. The PdfPageEditor class present in the Aspose.Pdf.Facades namespace provides the feature to update/manipulate pages of PDF document. It also offers the feature to set/update page dimensions of input PDF file. In order to accomplish our requirement, we can first load the source PDF document into PdfPageEditor object, update page dimensions and then render the output in HTML format using HtmlSaveOptions class. For further details, please visit PDF to HTML – Set Output File Size.

// Select desirable page size
float newPageWidth = 400f;
float newPageHeight = 400f;

// Tune PdfPageEditor class 
Aspose.Pdf.Facades.PdfPageEditor pdfEditor = new Aspose.Pdf.Facades.PdfPageEditor();
// Bind source PDF file
pdfEditor.BindPdf("c:/pdftest/TextReplaced.pdf");
// Set the page dimensions 
pdfEditor.PageSize = new Aspose.Pdf.PageSize(newPageWidth, newPageHeight);
// Set vertical alignment for page as center aligned
pdfEditor.VerticalAlignmentType = Aspose.Pdf.VerticalAlignment.Center;
// Set Horizontal alignment for page as center aligned
pdfEditor.HorizontalAlignment = Aspose.Pdf.HorizontalAlignment.Center;

// This scales page content to fit width,
// comment it out or set Zoom to 1.0F if You don't want to scale
// content and only want to change page's size(i.e. crop it)
float zoom = Math.Min((float)newPageWidth / (float)pdfEditor.Document.Pages[1].Rect.Width,
                    (float)newPageHeight / (float)pdfEditor.Document.Pages[1].Rect.Height);
pdfEditor.Zoom = zoom;// (float)595;

// Create stream object to hold file with updated dimensions
MemoryStream output = new MemoryStream();
// Save file to stream object
pdfEditor.Save(output);

// Then reload scaled document and save it to HTML
Document exportDoc = new Document(output);
HtmlSaveOptions htmlOptions = new HtmlSaveOptions();
// This code shows page boreder in result - sometimes it comes in handy to see borders
SaveOptions.BorderPartStyle borderStyle = new SaveOptions.BorderPartStyle();
borderStyle.LineType = SaveOptions.HtmlBorderLineType.Dotted;
borderStyle.Color = System.Drawing.Color.Gray;
htmlOptions.PageBorderIfAny = new SaveOptions.BorderInfo(borderStyle);

// Conversion to HTML itself
exportDoc.Save(@"C:\pdftest\37240_Test1.html", htmlOptions);
// Close the stream object
output.Close();

PDF to PDF/A-2A Conversion

Aspose.Pdf for .NET has been supporting conversion from PDF to PDF/A compliant documents and also offers the capability to validate a PDF file’s PDF/A compliance. In this release, we have added support for conversion of PDF to PDF/A_2a format. Therefore a new value PDF_A_2A is added to PdfFormat enumeration. Please try using the following code snippet to accomplish this requirement.

// Load PDF file
Document doc = new Aspose.Pdf.Document("input.pdf");
// Set PDF/A compliance as PDF/A_1a
doc.Convert(new MemoryStream(), PdfFormat.PDF_A_2A, ConvertErrorAction.Delete);
// Save updated document
doc.Save("compliant.pdf");

Add SVG Object to Table Cell

Aspose.Pdf for .NET supports the feature to add table cell inside PDF file. While creating table inside PDF file, we can add text or images inside table cells. Furthermore, this API also offers the feature to convert SVG files to PDF format. So with a blend of both features, we can accomplish the requirement of loading SVG image and add it inside table cells. For further details, please visit Add SVG Object to Table Cell.

// Instantiate Document object
Document doc = new Document();
// Create an image instance
Aspose.Pdf.Image img = new Aspose.Pdf.Image();
// Set image type as SVG
img.FileType = Aspose.Pdf.ImageFileType.Svg;
// Path for source file
img.File = "c:/pdftest/img_03.svg";
// Set width for image instance
img.FixWidth = 50;
// Set height for image instance
img.FixHeight = 50;
// Create table instance
Aspose.Pdf.Table table = new Aspose.Pdf.Table();
// Set width for table cells
table.ColumnWidths = "100 100";
// Create row object and add it to table instance
Aspose.Pdf.Row row = table.Rows.Add();
// Create cell object and add it to row instance
Aspose.Pdf.Cell cell = row.Cells.Add();
// Add textfragment to paragraphs collection of cell object
cell.Paragraphs.Add(new TextFragment("First cell"));
// Add another cell to row object
cell = row.Cells.Add();
// Add SVG image to paragraphs collection of recently added cell instance
cell.Paragraphs.Add(img);
// Create page object and add it to pages collection of document instance
Page page = doc.Pages.Add();
// Add table to paragraphs collection of page object
page.Paragraphs.Add(table);
// Save PDF file
doc.Save("c:/pdftest/SVG_in_TableCell.pdf");

Set TextFragment Formatting as Underline

A PDF file consists of elements such as Text, Images, Attachments, Annotations, Hyperlinks, Tables etc. When adding Text string to PDF file, we may have a requirement to set formatting for text instance. The latest release of Aspose.Pdf for .NET 9.7.0 offers the feature to set Underline formatting for TextFragment when adding to PDF file. Please try setting TextState.Underline property as true to accomplish this requirement.

// Instantiate Document instance
Document pdfDocument = new Document();
// Add page to PDF file
pdfDocument.Pages.Add();
// Create TextBuild object with first page as argument
TextBuilder tb = new TextBuilder(pdfDocument.Pages[1]);
// Create TextFragment instance with sample text
TextFragment fragment = new TextFragment("Test message");
// Set the font for TextFragment
fragment.TextState.Font = Aspose.Pdf.Text.FontRepository.FindFont("Arial");
// Set font size
fragment.TextState.FontSize = 10;
// Set text formatting as underline
fragment.TextState.Underline = true;
// Specify position for TextFragment
fragment.Position = new Position(10, 800);
// Add TextFragment to Text Builder instance
tb.AppendText(fragment);
// Save the PDF file
pdfDocument.Save("c:/pdftest/UnderLine_output.pdf");

Add Choice Option in Combobox Field

In case you need to add choice option to combo-box field in XFA form, then you need to update the XML template of the document so that the choice is added.

Document doc = new Document("37348.pdf");
string[] fields = doc.Form.XFA.FieldNames;
XmlNode node = doc.Form.XFA.GetFieldTemplate(fields[0]);
XmlNode items = node.SelectSingleNode("tpl:items", doc.Form.XFA.NamespaceManager);
XmlNode item = items.OwnerDocument.CreateNode(XmlNodeType.Element, "text", items.NamespaceURI);
item.InnerText = "Choice # 4 ( New )";
items.AppendChild(item);
doc.Save("37348-out.pdf");

Among the above stated new features/enhancements, there are numerous other features introduced in this release. We have also made fixes for issues reported in earlier releases. Please get a chance to download and try using the latest release of Aspose.Pdf for .NET 9.7.0

Posted in Aspose for .NET APIs, Aspose.Pdf Product Family, Nayyer Shahbaz | Leave a comment