Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
見出しは、どのドキュメントにおいても重要な部分です。作成者は常に見出しをより目立たせ、読者にとって意味のあるものにしようとします。ドキュメントに複数の見出しがある場合、作成者はこれらの見出しを整理するためのいくつかのオプションを持っています。見出しを整理する最も一般的なアプローチの1つは、番号スタイルで見出しを書くことです。
Aspose.PDF for .NETは多くの事前定義された番号スタイルを提供しています。これらの事前定義された番号スタイルは、列挙型NumberingStyleに格納されています。NumberingStyle列挙型の事前定義された値とその説明は以下の通りです:
見出しの種類 | 説明 |
---|---|
NumeralsArabic | アラビア数字タイプ、例えば、1,1.1,… |
NumeralsRomanUppercase | ローマ数字大文字タイプ、例えば、I,I.II,… |
NumeralsRomanLowercase | ローマ数字小文字タイプ、例えば、i,i.ii,… |
LettersUppercase | 英語大文字タイプ、例えば、A,A.B,… |
LettersLowercase | 英語小文字タイプ、例えば、a,a.b,… |
Aspose.Pdf.HeadingクラスのStyleプロパティは、見出しの番号スタイルを設定するために使用されます。 |
図:事前定義された番号スタイル |
---|
上記の図に示す出力を得るためのソースコードは、以下の例に示されています。 |
次のコードスニペットは、Aspose.Drawingライブラリでも動作します。
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void ApplyNumberStyleToPdf()
{
// The path to the documents directory
var dataDir = RunExamples.GetDataDir_AsposePdf_WorkingDocuments();
// Create PDF document
using (var document = new Aspose.Pdf.Document())
{
document.PageInfo.Width = 612.0;
document.PageInfo.Height = 792.0;
document.PageInfo.Margin = new Aspose.Pdf.MarginInfo();
document.PageInfo.Margin.Left = 72;
document.PageInfo.Margin.Right = 72;
document.PageInfo.Margin.Top = 72;
document.PageInfo.Margin.Bottom = 72;
// Add page
var pdfPage = document.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;
// Create a floating box with the same margin as the page
var floatBox = new Aspose.Pdf.FloatingBox();
floatBox.Margin = pdfPage.PageInfo.Margin;
// Add the floating box to the page
pdfPage.Paragraphs.Add(floatBox);
// Add headings with numbering styles
var heading = new Aspose.Pdf.Heading(1);
heading.IsInList = true;
heading.StartNumber = 1;
heading.Text = "List 1";
heading.Style = Aspose.Pdf.NumberingStyle.NumeralsRomanLowercase;
heading.IsAutoSequence = true;
floatBox.Paragraphs.Add(heading);
var heading2 = new Aspose.Pdf.Heading(1);
heading2.IsInList = true;
heading2.StartNumber = 13;
heading2.Text = "List 2";
heading2.Style = Aspose.Pdf.NumberingStyle.NumeralsRomanLowercase;
heading2.IsAutoSequence = true;
floatBox.Paragraphs.Add(heading2);
var 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 on account of each allowed";
heading3.Style = Aspose.Pdf.NumberingStyle.LettersLowercase;
heading3.IsAutoSequence = true;
floatBox.Paragraphs.Add(heading3);
// Save PDF document
document.Save(dataDir + "ApplyNumberStyle_out.pdf");
}
}
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.