翻譯|使用教程|編輯:李顯亮|2020-08-06 13:56:30.410|閱讀 293 次
概述:在本系列教程中,將為開發者帶來Aspose.PDF for .NET的一系列使用教程,例如進行文檔間的轉換,如何標記PDF文件,如何使用表單和圖表等等。本文將介紹如何在標題中應用編號樣式。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
Aspose.PDF for .NET是一種高PDF處理和解析API,用于在跨平臺應用程序中執行文檔管理和操作任務。API可以輕松用于生成、修改、轉換、渲染、保護和打印PDF文檔,而無需使用Adobe Acrobat。此外,API還提供PDF壓縮選項,表格創建和操作,圖形和圖像功能,廣泛的超鏈接功能,印章和水印任務,擴展的安全控制和自定義字體處理。
在接下來的系列教程中,將為開發者帶來Aspose.PDF for .NET的一系列使用教程,例如進行文檔間的轉換,如何標記PDF文件,如何使用表單和圖表等等。本文將介紹如何在標題中應用編號樣式。
>>Aspose.PDF for .NET更新至最新版v20.7,歡迎下載體驗。
標題是任何文檔的重要部分。作家總是試圖使標題對讀者更加突出和有意義。如果文檔中的標題不止一個,那么作者可以使用多種方法來組織這些標題。組織標題的最常見方法之一是用編號樣式編寫標題。
Aspose.PDF提供了許多預定義的編號樣式。這些預定義的編號樣式存儲在枚舉NumberingStyle中。下面給出NumberingStyle枚舉的預定義值及其說明:
標題類型 | 描述 |
---|---|
阿拉伯數字 | 阿拉伯類型,例如1,1.1,... |
羅馬數字 | 羅馬鞋面類型,例如I,I.II,… |
數字羅馬小寫 | 羅馬小寫字母,例如i,i.ii,… |
字母大寫 | 英文大寫字母,例如A,AB,… |
字母小寫 | 英文小寫字母,例如a,ab,… |
Aspose.PDF.Heading類的Style屬性用于設置標題的編號樣式。
下面的示例中給出了獲得上圖所示輸出的源代碼。
// The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdf_Headings(); Document pdfDoc = new Document(); pdfDoc.PageInfo.Width = 612.0; pdfDoc.PageInfo.Height = 792.0; pdfDoc.PageInfo.Margin = new Aspose.Pdf.MarginInfo(); pdfDoc.PageInfo.Margin.Left = 72; pdfDoc.PageInfo.Margin.Right = 72; pdfDoc.PageInfo.Margin.Top = 72; pdfDoc.PageInfo.Margin.Bottom = 72; Aspose.Pdf.Page pdfPage = pdfDoc.Pages.Add(); pdfPage.PageInfo.Width = 612.0; pdfPage.PageInfo.Height = 792.0; pdfPage.PageInfo.Margin = new Aspose.Pdf.MarginInfo(); pdfPage.PageInfo.Margin.Left = 72; pdfPage.PageInfo.Margin.Right = 72; pdfPage.PageInfo.Margin.Top = 72; pdfPage.PageInfo.Margin.Bottom = 72; Aspose.Pdf.FloatingBox floatBox = new Aspose.Pdf.FloatingBox(); floatBox.Margin = pdfPage.PageInfo.Margin; pdfPage.Paragraphs.Add(floatBox); TextFragment textFragment = new TextFragment(); TextSegment segment = new TextSegment(); Aspose.Pdf.Heading heading = new Aspose.Pdf.Heading(1); heading.IsInList = true; heading.StartNumber = 1; heading.Text = "List 1"; heading.Style = NumberingStyle.NumeralsRomanLowercase; heading.IsAutoSequence = true; floatBox.Paragraphs.Add(heading); Aspose.Pdf.Heading heading2 = new Aspose.Pdf.Heading(1); heading2.IsInList = true; heading2.StartNumber = 13; heading2.Text = "List 2"; heading2.Style = NumberingStyle.NumeralsRomanLowercase; heading2.IsAutoSequence = true; floatBox.Paragraphs.Add(heading2); Aspose.Pdf.Heading heading3 = new Aspose.Pdf.Heading(2); heading3.IsInList = true; heading3.StartNumber = 1; heading3.Text = "the value, as of the effective date of the plan, of property to be distributed under the plan onaccount of each allowed"; heading3.Style = NumberingStyle.LettersLowercase; heading3.IsAutoSequence = true; floatBox.Paragraphs.Add(heading3); dataDir = dataDir + "ApplyNumberStyle_out.pdf"; pdfDoc.Save(dataDir);
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn