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

Free Support Forum - aspose.com

Add PDF Page, Text and TextSegment in PDF Document using New Aspose.PDF DOM model

Hi,

Below is my old code using ASPOSE.PDF. generator. Can you let me know what are the altername of below classes in new DOM model?

Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf();
Aspose.Pdf.Generator.Section section = pdf.Sections.Add();

// Add image to section
Aspose.Pdf.Generator.Image logoImage = new Aspose.Pdf.Generator.Image(section);
section.Paragraphs.Add(logoImage);

// Add text to to section using Text class
Aspose.Pdf.Generator.Text textPdfHeader = new Aspose.Pdf.Generator.Text(section, " my html ")
textPdfHeader.IsHtmlTagSupported = true;
section.Paragraphs.Add(textPdfHeader);

// Add barcode to section object

Aspose.Pdf.Generator.Text textBarcode = new Aspose.Pdf.Generator.Text(section);
Aspose.Pdf.Generator.Segment segmentBarcode = textBarcode.Segments.Add();
Aspose.Pdf.Generator.Segment segmentBlank = textBarcode.Segments.Add();
Aspose.Pdf.Generator.Segment segmentMatrix = textBarcode.Segments.Add();

segmentBarcode.InlineParagraph = Barcode(section);
segmentBlank.Content = SegmentWidth;
segmentMatrix.InlineParagraph = MatrixBarCode(section);
segmentMatrix.TextInfo.IsRightToLeft = true;
section.Paragraphs.Add(textBarcode);

@sadyalajay,
In order to understand the new DOM approach, please go through this help topic: Introduction to the DOM API. Please use Document, Page, TextFragmment, HtmlFragment to achieve the requirement. This is the complete developers guide of new DOM approach: Developer Guide