public static void Run() { // ExStart:UserDefinedBullets // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfGenerator_Headings(); // Instntiate the Pdf object by calling its empty constructor Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf(); // Create the section in the Pdf object Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add(); /* * Create 1st heading in the Pdf object's section with level=1. Then create a text * segment and add it in the heading. Set its UserLabel="98" to use a user defined * bullet. You must set BulletFontName to "Symbol" or "ZapfDingbats". After setting * all properties, add heading into the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading1 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 1); Aspose.Pdf.Generator.Segment segment1 = new Aspose.Pdf.Generator.Segment(heading1); heading1.Segments.Add(segment1); segment1.Content = "Symbol"; heading1.BulletFontName = "Symbol"; heading1.UserLabel = "98"; sec1.Paragraphs.Add(heading1); /* * Create 2nd heading in the Pdf object's section with level=2. Then create a text * segment and add it in the heading. Set its UserLabel="99" to use a user defined * bullet. You must set BulletFontName to "Symbol" or "ZapfDingbats". After setting * all properties, add heading into the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading2 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 2); Aspose.Pdf.Generator.Segment segment2 = new Aspose.Pdf.Generator.Segment(heading2); heading2.Segments.Add(segment2); segment2.Content = "Symbol"; heading2.BulletFontName = "Symbol"; heading2.UserLabel = "99"; sec1.Paragraphs.Add(heading2); /* * Create 3rd heading in the Pdf object's section with level=3. Then create a text * segment and add it in the heading. Set its UserLabel="100" to use a user defined * bullet. You must set BulletFontName to "Symbol" or "ZapfDingbats". After setting * all properties, add heading into the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading3 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 3); Aspose.Pdf.Generator.Segment segment3 = new Aspose.Pdf.Generator.Segment(heading3); heading3.Segments.Add(segment3); segment3.Content = "Symbol"; heading3.BulletFontName = "Symbol"; heading3.UserLabel = "100"; sec1.Paragraphs.Add(heading3); pdf1.Save(dataDir + "UserDefinedBullets_out.pdf"); // ExEnd:UserDefinedBullets }
public static void Run() { // ExStart:BindXML // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfGenerator_TechnicalArticles(); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(dataDir + "Sample.xml"); Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf(); // Object xmlDoc contains all contents from original word document in XML format defined in Aspose.PDF XML Schema. pdf.BindXML(xmlDoc, null); // Before saving, to add bookmarks from headings. pdf.IsBookmarked = true; foreach (Aspose.Pdf.Generator.Section sec in pdf.Sections) { foreach (Aspose.Pdf.Generator.Paragraph para in sec.Paragraphs) { if (para is Aspose.Pdf.Generator.Heading) { Aspose.Pdf.Generator.Heading h = para as Aspose.Pdf.Generator.Heading; h.IsInList = true; } } } pdf.Save(dataDir + "BindXML_out_.pdf"); // ExEnd:BindXML }
public static void Run() { // ExStart:UserDefinedBullets // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfGenerator_Headings(); // Instntiate the Pdf object by calling its empty constructor Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf(); // Create the section in the Pdf object Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add(); /* * Create 1st heading in the Pdf object's section with level=1. Then create a text * segment and add it in the heading. Set its UserLabel="98" to use a user defined * bullet. You must set BulletFontName to "Symbol" or "ZapfDingbats". After setting * all properties, add heading into the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading1 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 1); Aspose.Pdf.Generator.Segment segment1 = new Aspose.Pdf.Generator.Segment(heading1); heading1.Segments.Add(segment1); segment1.Content = "Symbol"; heading1.BulletFontName = "Symbol"; heading1.UserLabel = "98"; sec1.Paragraphs.Add(heading1); /* * Create 2nd heading in the Pdf object's section with level=2. Then create a text * segment and add it in the heading. Set its UserLabel="99" to use a user defined * bullet. You must set BulletFontName to "Symbol" or "ZapfDingbats". After setting * all properties, add heading into the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading2 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 2); Aspose.Pdf.Generator.Segment segment2 = new Aspose.Pdf.Generator.Segment(heading2); heading2.Segments.Add(segment2); segment2.Content = "Symbol"; heading2.BulletFontName = "Symbol"; heading2.UserLabel = "99"; sec1.Paragraphs.Add(heading2); /* * Create 3rd heading in the Pdf object's section with level=3. Then create a text * segment and add it in the heading. Set its UserLabel="100" to use a user defined * bullet. You must set BulletFontName to "Symbol" or "ZapfDingbats". After setting * all properties, add heading into the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading3 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 3); Aspose.Pdf.Generator.Segment segment3 = new Aspose.Pdf.Generator.Segment(heading3); heading3.Segments.Add(segment3); segment3.Content = "Symbol"; heading3.BulletFontName = "Symbol"; heading3.UserLabel = "100"; sec1.Paragraphs.Add(heading3); pdf1.Save(dataDir + "UserDefinedBullets_out_.pdf"); // ExEnd:UserDefinedBullets }
public static void Run() { // ExStart:SystemBullets // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfGenerator_Headings(); // Instntiate the Pdf object by calling its empty constructor Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf(); // Create the section in the Pdf object Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add(); /* * Create 1st heading in the Pdf object's section with level=1. Then create * a text segment and add it in the heading. Set its UserLabel="Bullet1" to * use system defined bullet. After setting all properties, add heading into * the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading1 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 1); Aspose.Pdf.Generator.Segment segment1 = new Aspose.Pdf.Generator.Segment(heading1); heading1.Segments.Add(segment1); segment1.Content = "Bullet1"; heading1.UserLabel = "Bullet1"; sec1.Paragraphs.Add(heading1); /* * Create 2nd heading in the Pdf object's section with level=2. Then create * a text segment and add it in the heading. Set its UserLabel="Bullet2" to * use system defined bullet. After setting all properties, add heading into * the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading2 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 2); Aspose.Pdf.Generator.Segment segment2 = new Aspose.Pdf.Generator.Segment(heading2); heading2.Segments.Add(segment2); segment2.Content = "Bullet2"; heading2.UserLabel = "Bullet2"; sec1.Paragraphs.Add(heading2); /* * Create 3rd heading in the Pdf object's section with level=3. Then create * a text segment and add it in the heading. Set its UserLabel="Bullet3" to * use system defined bullet. After setting all properties, add heading into * the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading3 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 3); Aspose.Pdf.Generator.Segment segment3 = new Aspose.Pdf.Generator.Segment(heading3); heading3.Segments.Add(segment3); segment3.Content = "Bullet3"; heading3.UserLabel = "Bullet3"; sec1.Paragraphs.Add(heading3); pdf1.Save(dataDir + "SystemBullets_out_.pdf"); // ExEnd:SystemBullets }
public static void Run() { // ExStart:SystemBullets // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfGenerator_Headings(); // Instntiate the Pdf object by calling its empty constructor Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf(); // Create the section in the Pdf object Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add(); /* * Create 1st heading in the Pdf object's section with level=1. Then create * a text segment and add it in the heading. Set its UserLabel="Bullet1" to * use system defined bullet. After setting all properties, add heading into * the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading1 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 1); Aspose.Pdf.Generator.Segment segment1 = new Aspose.Pdf.Generator.Segment(heading1); heading1.Segments.Add(segment1); segment1.Content = "Bullet1"; heading1.UserLabel = "Bullet1"; sec1.Paragraphs.Add(heading1); /* * Create 2nd heading in the Pdf object's section with level=2. Then create * a text segment and add it in the heading. Set its UserLabel="Bullet2" to * use system defined bullet. After setting all properties, add heading into * the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading2 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 2); Aspose.Pdf.Generator.Segment segment2 = new Aspose.Pdf.Generator.Segment(heading2); heading2.Segments.Add(segment2); segment2.Content = "Bullet2"; heading2.UserLabel = "Bullet2"; sec1.Paragraphs.Add(heading2); /* * Create 3rd heading in the Pdf object's section with level=3. Then create * a text segment and add it in the heading. Set its UserLabel="Bullet3" to * use system defined bullet. After setting all properties, add heading into * the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading3 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 3); Aspose.Pdf.Generator.Segment segment3 = new Aspose.Pdf.Generator.Segment(heading3); heading3.Segments.Add(segment3); segment3.Content = "Bullet3"; heading3.UserLabel = "Bullet3"; sec1.Paragraphs.Add(heading3); pdf1.Save(dataDir + "SystemBullets_out.pdf"); // ExEnd:SystemBullets }
public static void Run() { // ExStart:SpecifyListItem // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfGenerator_UtilityFeatures(); // Instantiate Pdf instance by calling its empty constructor Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf(); // Create a section in the Pdf document Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add(); // Add four headings in the section for (int Level = 1; Level != 5; Level++) { Aspose.Pdf.Generator.Heading heading2 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, Level); Aspose.Pdf.Generator.Segment segment2 = new Aspose.Pdf.Generator.Segment(heading2); heading2.Segments.Add(segment2); heading2.IsAutoSequence = true; segment2.Content = "this is heading of level "; segment2.Content += Level.ToString(); // Add the heading into Table Of Contents. heading2.IsInList = true; sec1.Paragraphs.Add(heading2); } // Create a graph and add a curve shape to its shapes collection Aspose.Pdf.Generator.Graph graph1 = new Aspose.Pdf.Generator.Graph(sec1, 100, 400); sec1.Paragraphs.Add(graph1); float[] posArr = new float[] { 0, 0, 200, 80, 300, 40, 350, 90 }; Aspose.Pdf.Generator.Curve curve1 = new Aspose.Pdf.Generator.Curve(graph1, posArr); graph1.Shapes.Add(curve1); // Add the Graph to the List of Figures graph1.IsInList = true; dataDir = dataDir + "SpecifyListItem_out_.pdf"; // Save the Pdf pdf1.Save(dataDir); // ExEnd:SpecifyListItem }
public static void Run() { // ExStart:SpecifyListItem // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfGenerator_UtilityFeatures(); // Instantiate Pdf instance by calling its empty constructor Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf(); // Create a section in the Pdf document Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add(); // Add four headings in the section for (int Level = 1; Level != 5; Level++) { Aspose.Pdf.Generator.Heading heading2 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, Level); Aspose.Pdf.Generator.Segment segment2 = new Aspose.Pdf.Generator.Segment(heading2); heading2.Segments.Add(segment2); heading2.IsAutoSequence = true; segment2.Content = "this is heading of level "; segment2.Content += Level.ToString(); // Add the heading into Table Of Contents. heading2.IsInList = true; sec1.Paragraphs.Add(heading2); } // Create a graph and add a curve shape to its shapes collection Aspose.Pdf.Generator.Graph graph1 = new Aspose.Pdf.Generator.Graph(sec1, 100, 400); sec1.Paragraphs.Add(graph1); float[] posArr = new float[] { 0, 0, 200, 80, 300, 40, 350, 90 }; Aspose.Pdf.Generator.Curve curve1 = new Aspose.Pdf.Generator.Curve(graph1, posArr); graph1.Shapes.Add(curve1); // Add the Graph to the List of Figures graph1.IsInList = true; dataDir = dataDir + "SpecifyListItem_out.pdf"; // Save the Pdf pdf1.Save(dataDir); // ExEnd:SpecifyListItem }
public static void Run() { // ExStart:AddBookmark // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfGenerator_UtilityFeatures(); // Instantiate the Pdf instance Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf(); // Set the value that PDF document will be Bookmarked pdf1.IsBookmarked = true; // Specify bookmark level pdf1.BookmarkLevel = 1; // Create Section object and add it to PDF Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add(); Aspose.Pdf.Generator.Heading heading1 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 1); Aspose.Pdf.Generator.Segment segment1 = new Aspose.Pdf.Generator.Segment(heading1); heading1.Segments.Add(segment1); heading1.IsAutoSequence = true; segment1.Content = "this is heading of level 1"; sec1.Paragraphs.Add(heading1); Aspose.Pdf.Generator.Heading heading2 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 2); Aspose.Pdf.Generator.Segment segment2 = new Aspose.Pdf.Generator.Segment(heading2); heading2.Segments.Add(segment2); heading2.IsAutoSequence = true; segment2.Content = "this is heading of level 2"; sec1.Paragraphs.Add(heading2); Aspose.Pdf.Generator.Heading heading3 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 1); Aspose.Pdf.Generator.Segment segment3 = new Aspose.Pdf.Generator.Segment(heading3); heading3.Segments.Add(segment3); heading3.IsAutoSequence = false; heading3.LabelWidth = 60; heading3.UserLabel = "bullet1"; segment3.Content = "this is bullet style 1"; sec1.Paragraphs.Add(heading3); dataDir = dataDir + "AddBookmark_out_.pdf"; pdf1.Save(dataDir); // ExEnd:AddBookmark }
public static void Run() { // ExStart:AddBookmark // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfGenerator_UtilityFeatures(); // Instantiate the Pdf instance Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf(); // Set the value that PDF document will be Bookmarked pdf1.IsBookmarked = true; // Specify bookmark level pdf1.BookmarkLevel = 1; // Create Section object and add it to PDF Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add(); Aspose.Pdf.Generator.Heading heading1 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 1); Aspose.Pdf.Generator.Segment segment1 = new Aspose.Pdf.Generator.Segment(heading1); heading1.Segments.Add(segment1); heading1.IsAutoSequence = true; segment1.Content = "this is heading of level 1"; sec1.Paragraphs.Add(heading1); Aspose.Pdf.Generator.Heading heading2 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 2); Aspose.Pdf.Generator.Segment segment2 = new Aspose.Pdf.Generator.Segment(heading2); heading2.Segments.Add(segment2); heading2.IsAutoSequence = true; segment2.Content = "this is heading of level 2"; sec1.Paragraphs.Add(heading2); Aspose.Pdf.Generator.Heading heading3 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 1); Aspose.Pdf.Generator.Segment segment3 = new Aspose.Pdf.Generator.Segment(heading3); heading3.Segments.Add(segment3); heading3.IsAutoSequence = false; heading3.LabelWidth = 60; heading3.UserLabel = "bullet1"; segment3.Content = "this is bullet style 1"; sec1.Paragraphs.Add(heading3); dataDir = dataDir + "AddBookmark_out.pdf"; pdf1.Save(dataDir); // ExEnd:AddBookmark }
public static void Run() { // ExStart:ApplyingNumber // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfGenerator_Headings(); // Instntiate the Pdf object by calling its empty constructor Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf(); // Create the section in the Pdf object Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add(); /* * Create 1st heading in the Pdf object's section with level=1. Then create * a text segment and add it in the heading. Set its numbering style to "Arab" * using HeadingType enumeration. And don't forget to set IsAutoSequence=true. * If IsAutoSeguence property is set to true then the heading's sequence is * controlled automatically by Aspose.Pdf. After setting all properties, add * heading into the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading1 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 1); Aspose.Pdf.Generator.Segment segment1 = new Aspose.Pdf.Generator.Segment(heading1); heading1.Segments.Add(segment1); segment1.Content = "Arab"; heading1.HeadingType = Aspose.Pdf.Generator.HeadingType.Arab; heading1.IsAutoSequence = true; sec1.Paragraphs.Add(heading1); /* * Create 2nd heading in the Pdf object's section with level=1. Then create * a text segment and add it in the heading. Set its numbering style to "RomanUpper" * using HeadingType enumeration. And don't forget to set IsAutoSequence=true. * If IsAutoSeguence property is set to true then the heading's sequence is * controlled automatically by Aspose.Pdf for .NET. After setting all properties, add * heading into the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading2 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 1); Aspose.Pdf.Generator.Segment segment2 = new Aspose.Pdf.Generator.Segment(heading2); heading2.Segments.Add(segment2); segment2.Content = "RomanUpper"; heading2.HeadingType = Aspose.Pdf.Generator.HeadingType.RomanUpper; heading2.IsAutoSequence = true; sec1.Paragraphs.Add(heading2); /* * Create 3rd heading in the Pdf object's section with level=1. Then create * a text segment and add it in the heading. Set its numbering style to "RomanLower" * using HeadingType enumeration. And don't forget to set IsAutoSequence=true. * If IsAutoSeguence property is set to true then the heading's sequence is * controlled automatically by Aspose.Pdf for .NET. After setting all properties, add * heading into the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading3 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 1); Aspose.Pdf.Generator.Segment segment3 = new Aspose.Pdf.Generator.Segment(heading3); heading3.Segments.Add(segment3); segment3.Content = "RomanLower"; heading3.HeadingType = Aspose.Pdf.Generator.HeadingType.RomanLower; heading3.IsAutoSequence = true; sec1.Paragraphs.Add(heading3); /* * Create 4th heading in the Pdf object's section with level=1. Then create a * text segment and add it in the heading. Set its numbering style to "EnglishUpper" * using HeadingType enumeration. And don't forget to set IsAutoSequence=true. * If IsAutoSeguence property is set to true then the heading's sequence is * controlled automatically by Aspose.Pdf for .NET. After setting all properties, add * heading into the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading4 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 1); Aspose.Pdf.Generator.Segment segment4 = new Aspose.Pdf.Generator.Segment(heading4); heading4.Segments.Add(segment4); segment4.Content = "EnglishUpper"; heading4.HeadingType = Aspose.Pdf.Generator.HeadingType.EnglishUpper; heading4.IsAutoSequence = true; sec1.Paragraphs.Add(heading4); /* * Create 5th heading in the Pdf object's section with level=1. Then create a * text segment and add it in the heading. Set its numbering style to "EnglishLower" * using HeadingType enumeration. And don't forget to set IsAutoSequence=true. * If IsAutoSeguence property is set to true then the heading's sequence is * controlled automatically by Aspose.Pdf for .NET. After setting all properties, add * heading into the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading5 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 1); Aspose.Pdf.Generator.Segment segment5 = new Aspose.Pdf.Generator.Segment(heading5); heading5.Segments.Add(segment5); segment5.Content = "EnglishLower"; heading5.HeadingType = Aspose.Pdf.Generator.HeadingType.EnglishLower; heading5.IsAutoSequence = true; sec1.Paragraphs.Add(heading5); pdf1.Save( dataDir + "headings_out.pdf"); // ExEnd:ApplyingNumber }
public static void Run() { // ExStart:SpecifyHeadingLevel // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfGenerator_Headings(); // Instntiate the Pdf object by calling its empty constructor Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf(); // Create the section in the Pdf object Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add(); /* * Create 1st heading in the Pdf object's section with level=1. Then create * a text segment and add it in the heading. Set its StartNumber=6 to start * the numbering from 6 and onwards. And don't forget to set IsAutoSequence=true. * If IsAutoSeguence property is set to true then the heading's sequence is * controlled automatically by Aspose.Pdf for .NET. After setting all properties, add * heading into the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading1 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 1); Aspose.Pdf.Generator.Segment segment1 = new Aspose.Pdf.Generator.Segment(heading1); heading1.Segments.Add(segment1); segment1.Content = "Level 1"; heading1.IsAutoSequence = true; heading1.StartNumber = 6; sec1.Paragraphs.Add(heading1); /* * Create 2nd heading in the Pdf object's section with level=2. Then create * a text segment and add it in the heading. And don't forget to set * IsAutoSequence=true.If IsAutoSeguence property is set to true then the * heading's sequence is controlled automatically by Aspose.Pdf for .NET. After setting * all properties, add heading into the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading2 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 2); Aspose.Pdf.Generator.Segment segment2 = new Aspose.Pdf.Generator.Segment(heading2); heading2.Segments.Add(segment2); segment2.Content = "Level 2"; heading2.IsAutoSequence = true; sec1.Paragraphs.Add(heading2); /* * Create 3rd heading in the Pdf object's section with level=3. Then create * a text segment and add it in the heading. And don't forget to set * IsAutoSequence=true.If IsAutoSeguence property is set to true then the * heading's sequence is controlled automatically by Aspose.Pdf for .NET. After setting * all properties, add heading into the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading3 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 3); Aspose.Pdf.Generator.Segment segment3 = new Aspose.Pdf.Generator.Segment(heading3); heading3.Segments.Add(segment3); segment3.Content = "Level 3"; heading3.IsAutoSequence = true; sec1.Paragraphs.Add(heading3); pdf1.Save(dataDir + "SpecifyHeadingLevel_out.pdf"); // ExEnd:SpecifyHeadingLevel }
public static void Run() { // ExStart:ApplyingNumber // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfGenerator_Headings(); // Instntiate the Pdf object by calling its empty constructor Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf(); // Create the section in the Pdf object Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add(); /* * Create 1st heading in the Pdf object's section with level=1. Then create * a text segment and add it in the heading. Set its numbering style to "Arab" * using HeadingType enumeration. And don't forget to set IsAutoSequence=true. * If IsAutoSeguence property is set to true then the heading's sequence is * controlled automatically by Aspose.Pdf. After setting all properties, add * heading into the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading1 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 1); Aspose.Pdf.Generator.Segment segment1 = new Aspose.Pdf.Generator.Segment(heading1); heading1.Segments.Add(segment1); segment1.Content = "Arab"; heading1.HeadingType = Aspose.Pdf.Generator.HeadingType.Arab; heading1.IsAutoSequence = true; sec1.Paragraphs.Add(heading1); /* * Create 2nd heading in the Pdf object's section with level=1. Then create * a text segment and add it in the heading. Set its numbering style to "RomanUpper" * using HeadingType enumeration. And don't forget to set IsAutoSequence=true. * If IsAutoSeguence property is set to true then the heading's sequence is * controlled automatically by Aspose.Pdf for .NET. After setting all properties, add * heading into the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading2 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 1); Aspose.Pdf.Generator.Segment segment2 = new Aspose.Pdf.Generator.Segment(heading2); heading2.Segments.Add(segment2); segment2.Content = "RomanUpper"; heading2.HeadingType = Aspose.Pdf.Generator.HeadingType.RomanUpper; heading2.IsAutoSequence = true; sec1.Paragraphs.Add(heading2); /* * Create 3rd heading in the Pdf object's section with level=1. Then create * a text segment and add it in the heading. Set its numbering style to "RomanLower" * using HeadingType enumeration. And don't forget to set IsAutoSequence=true. * If IsAutoSeguence property is set to true then the heading's sequence is * controlled automatically by Aspose.Pdf for .NET. After setting all properties, add * heading into the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading3 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 1); Aspose.Pdf.Generator.Segment segment3 = new Aspose.Pdf.Generator.Segment(heading3); heading3.Segments.Add(segment3); segment3.Content = "RomanLower"; heading3.HeadingType = Aspose.Pdf.Generator.HeadingType.RomanLower; heading3.IsAutoSequence = true; sec1.Paragraphs.Add(heading3); /* * Create 4th heading in the Pdf object's section with level=1. Then create a * text segment and add it in the heading. Set its numbering style to "EnglishUpper" * using HeadingType enumeration. And don't forget to set IsAutoSequence=true. * If IsAutoSeguence property is set to true then the heading's sequence is * controlled automatically by Aspose.Pdf for .NET. After setting all properties, add * heading into the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading4 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 1); Aspose.Pdf.Generator.Segment segment4 = new Aspose.Pdf.Generator.Segment(heading4); heading4.Segments.Add(segment4); segment4.Content = "EnglishUpper"; heading4.HeadingType = Aspose.Pdf.Generator.HeadingType.EnglishUpper; heading4.IsAutoSequence = true; sec1.Paragraphs.Add(heading4); /* * Create 5th heading in the Pdf object's section with level=1. Then create a * text segment and add it in the heading. Set its numbering style to "EnglishLower" * using HeadingType enumeration. And don't forget to set IsAutoSequence=true. * If IsAutoSeguence property is set to true then the heading's sequence is * controlled automatically by Aspose.Pdf for .NET. After setting all properties, add * heading into the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading5 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 1); Aspose.Pdf.Generator.Segment segment5 = new Aspose.Pdf.Generator.Segment(heading5); heading5.Segments.Add(segment5); segment5.Content = "EnglishLower"; heading5.HeadingType = Aspose.Pdf.Generator.HeadingType.EnglishLower; heading5.IsAutoSequence = true; sec1.Paragraphs.Add(heading5); pdf1.Save(dataDir + "headings_out.pdf"); // ExEnd:ApplyingNumber }
public static void Run() { // ExStart:SpecifyHeadingLevel // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfGenerator_Headings(); // Instntiate the Pdf object by calling its empty constructor Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf(); // Create the section in the Pdf object Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add(); /* * Create 1st heading in the Pdf object's section with level=1. Then create * a text segment and add it in the heading. Set its StartNumber=6 to start * the numbering from 6 and onwards. And don't forget to set IsAutoSequence=true. * If IsAutoSeguence property is set to true then the heading's sequence is * controlled automatically by Aspose.Pdf for .NET. After setting all properties, add * heading into the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading1 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 1); Aspose.Pdf.Generator.Segment segment1 = new Aspose.Pdf.Generator.Segment(heading1); heading1.Segments.Add(segment1); segment1.Content = "Level 1"; heading1.IsAutoSequence = true; heading1.StartNumber = 6; sec1.Paragraphs.Add(heading1); /* * Create 2nd heading in the Pdf object's section with level=2. Then create * a text segment and add it in the heading. And don't forget to set * IsAutoSequence=true.If IsAutoSeguence property is set to true then the * heading's sequence is controlled automatically by Aspose.Pdf for .NET. After setting * all properties, add heading into the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading2 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 2); Aspose.Pdf.Generator.Segment segment2 = new Aspose.Pdf.Generator.Segment(heading2); heading2.Segments.Add(segment2); segment2.Content = "Level 2"; heading2.IsAutoSequence = true; sec1.Paragraphs.Add(heading2); /* * Create 3rd heading in the Pdf object's section with level=3. Then create * a text segment and add it in the heading. And don't forget to set * IsAutoSequence=true.If IsAutoSeguence property is set to true then the * heading's sequence is controlled automatically by Aspose.Pdf for .NET. After setting * all properties, add heading into the paragraphs collection of the section */ Aspose.Pdf.Generator.Heading heading3 = new Aspose.Pdf.Generator.Heading(pdf1, sec1, 3); Aspose.Pdf.Generator.Segment segment3 = new Aspose.Pdf.Generator.Segment(heading3); heading3.Segments.Add(segment3); segment3.Content = "Level 3"; heading3.IsAutoSequence = true; sec1.Paragraphs.Add(heading3); pdf1.Save(dataDir + "SpecifyHeadingLevel_out.pdf"); // ExEnd:SpecifyHeadingLevel }