PDF管理控件Aspose.PDF for .Net使用教程(四十):設(shè)置帶標(biāo)簽的PDF元素屬性
Aspose.PDF for .NET是一種高PDF處理和解析API,用于在跨平臺應(yīng)用程序中執(zhí)行文檔管理和操作任務(wù)。API可以輕松用于生成、修改、轉(zhuǎn)換、渲染、保護(hù)和打印PDF文檔,而無需使用Adobe Acrobat。此外,API還提供PDF壓縮選項(xiàng),表格創(chuàng)建和操作,圖形和圖像功能,廣泛的超鏈接功能,印章和水印任務(wù),擴(kuò)展的安全控制和自定義字體處理。
在接下來的系列教程中,將為開發(fā)者帶來Aspose.PDF for .NET的一系列使用教程,例如進(jìn)行文檔間的轉(zhuǎn)換,如何標(biāo)記PDF文件,如何使用表單和圖表等等。本文將介紹如何設(shè)置帶標(biāo)簽的PDF元素屬性。包括:
- 設(shè)置結(jié)構(gòu)元素屬性
- 設(shè)置文本結(jié)構(gòu)元素
- 設(shè)置文本塊結(jié)構(gòu)元素
- 設(shè)置內(nèi)聯(lián)結(jié)構(gòu)元素
- 設(shè)置自定義標(biāo)簽名稱
- 在元素中添加結(jié)構(gòu)元素
- 設(shè)置鏈接結(jié)構(gòu)元素
- 設(shè)置注釋結(jié)構(gòu)元素
- 設(shè)置語言和標(biāo)題
>>Aspose.PDF for .NET更新至最新版v20.6,歡迎下載體驗(yàn)。
設(shè)置結(jié)構(gòu)元素屬性
為了在標(biāo)記的PDF文檔中設(shè)置結(jié)構(gòu)元素屬性,Aspose.PDF提供了ITaggedContent 接口的CreateSectElement() 和 CreateHeaderElement()方法 。以下代碼段顯示了如何設(shè)置帶標(biāo)簽的PDF文檔的結(jié)構(gòu)元素屬性:
// The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdf_WorkingDocuments(); // Create Pdf Document Document document = new Document(); // Get Content for work with TaggedPdf ITaggedContent taggedContent = document.TaggedContent; // Set Title and Language for Documnet taggedContent.SetTitle("Tagged Pdf Document"); taggedContent.SetLanguage("en-US"); // Create Structure Elements StructureElement rootElement = taggedContent.RootElement; SectElement sect = taggedContent.CreateSectElement(); rootElement.AppendChild(sect); HeaderElement h1 = taggedContent.CreateHeaderElement(1); sect.AppendChild(h1); h1.SetText("The Header"); h1.Title = "Title"; h1.Language = "en-US"; h1.AlternativeText = "Alternative Text"; h1.ExpansionText = "Expansion Text"; h1.ActualText = "Actual Text"; // Save Tagged Pdf Document document.Save(dataDir + "StructureElementsProperties.pdf");
設(shè)置文字結(jié)構(gòu)元素
為了設(shè)置標(biāo)簽PDF文檔的文本結(jié)構(gòu)元素,Aspose.PDF提供了ParagraphElement 類。以下代碼段顯示了如何設(shè)置帶標(biāo)簽的PDF文檔的文本結(jié)構(gòu)元素:
// The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdf_WorkingDocuments(); // Create Pdf Document Document document = new Document(); // Get Content for work with TaggedPdf ITaggedContent taggedContent = document.TaggedContent; // Set Title and Language for Documnet taggedContent.SetTitle("Tagged Pdf Document"); taggedContent.SetLanguage("en-US"); // Get Root Structure Elements StructureElement rootElement = taggedContent.RootElement; ParagraphElement p = taggedContent.CreateParagraphElement(); // Set Text to Text Structure Element p.SetText("Paragraph."); rootElement.AppendChild(p); // Save Tagged Pdf Document document.Save(dataDir + "TextStructureElement.pdf");
設(shè)置文本塊結(jié)構(gòu)元素
為了設(shè)置標(biāo)簽PDF文檔的文本塊結(jié)構(gòu)元素,Aspose.PDF提供了HeaderElement 和 ParagraphElement類。將這些類的對象附加為StructureElement 對象的子代。以下代碼段顯示了如何設(shè)置帶標(biāo)簽的PDF文檔的文本塊結(jié)構(gòu)元素:
// The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdf_WorkingDocuments(); // Create Pdf Document Document document = new Document(); // Get Content for work with TaggedPdf ITaggedContent taggedContent = document.TaggedContent; // Set Title and Language for Documnet taggedContent.SetTitle("Tagged Pdf Document"); taggedContent.SetLanguage("en-US"); // Get Root Structure Element StructureElement rootElement = taggedContent.RootElement; HeaderElement h1 = taggedContent.CreateHeaderElement(1); HeaderElement h2 = taggedContent.CreateHeaderElement(2); HeaderElement h3 = taggedContent.CreateHeaderElement(3); HeaderElement h4 = taggedContent.CreateHeaderElement(4); HeaderElement h5 = taggedContent.CreateHeaderElement(5); HeaderElement h6 = taggedContent.CreateHeaderElement(6); h1.SetText("H1. Header of Level 1"); h2.SetText("H2. Header of Level 2"); h3.SetText("H3. Header of Level 3"); h4.SetText("H4. Header of Level 4"); h5.SetText("H5. Header of Level 5"); h6.SetText("H6. Header of Level 6"); rootElement.AppendChild(h1); rootElement.AppendChild(h2); rootElement.AppendChild(h3); rootElement.AppendChild(h4); rootElement.AppendChild(h5); rootElement.AppendChild(h6); ParagraphElement p = taggedContent.CreateParagraphElement(); p.SetText("P. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean nec lectus ac sem faucibus imperdiet. Sed ut erat ac magna ullamcorper hendrerit. Cras pellentesque libero semper, gravida magna sed, luctus leo. Fusce lectus odio, laoreet nec ullamcorper ut, molestie eu elit. Interdum et malesuada fames ac ante ipsum primis in faucibus. Aliquam lacinia sit amet elit ac consectetur. Donec cursus condimentum ligula, vitae volutpat sem tristique eget. Nulla in consectetur massa. Vestibulum vitae lobortis ante. Nulla ullamcorper pellentesque justo rhoncus accumsan. Mauris ornare eu odio non lacinia. Aliquam massa leo, rhoncus ac iaculis eget, tempus et magna. Sed non consectetur elit. Sed vulputate, quam sed lacinia luctus, ipsum nibh fringilla purus, vitae posuere risus odio id massa. Cras sed venenatis lacus."); rootElement.AppendChild(p); // Save Tagged Pdf Document document.Save(dataDir + "TextBlockStructureElements.pdf");
設(shè)置內(nèi)聯(lián)結(jié)構(gòu)元素
為了設(shè)置帶標(biāo)簽的PDF文檔的內(nèi)聯(lián)結(jié)構(gòu)元素,Aspose.PDF提供了SpanElement 和 ParagraphElement 類。可以將這些類的對象附加為StructureElement 對象的子代。以下代碼段顯示了如何設(shè)置帶標(biāo)簽的PDF文檔的內(nèi)聯(lián)結(jié)構(gòu)元素:
// The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdf_WorkingDocuments(); // Create Pdf Document Document document = new Document(); // Get Content for work with TaggedPdf ITaggedContent taggedContent = document.TaggedContent; // Set Title and Language for Documnet taggedContent.SetTitle("Tagged Pdf Document"); taggedContent.SetLanguage("en-US"); // Get Root Structure Element StructureElement rootElement = taggedContent.RootElement; HeaderElement h1 = taggedContent.CreateHeaderElement(1); HeaderElement h2 = taggedContent.CreateHeaderElement(2); HeaderElement h3 = taggedContent.CreateHeaderElement(3); HeaderElement h4 = taggedContent.CreateHeaderElement(4); HeaderElement h5 = taggedContent.CreateHeaderElement(5); HeaderElement h6 = taggedContent.CreateHeaderElement(6); rootElement.AppendChild(h1); rootElement.AppendChild(h2); rootElement.AppendChild(h3); rootElement.AppendChild(h4); rootElement.AppendChild(h5); rootElement.AppendChild(h6); SpanElement spanH11 = taggedContent.CreateSpanElement(); spanH11.SetText("H1. "); h1.AppendChild(spanH11); SpanElement spanH12 = taggedContent.CreateSpanElement(); spanH12.SetText("Level 1 Header"); h1.AppendChild(spanH12); SpanElement spanH21 = taggedContent.CreateSpanElement(); spanH21.SetText("H2. "); h2.AppendChild(spanH21); SpanElement spanH22 = taggedContent.CreateSpanElement(); spanH22.SetText("Level 2 Header"); h2.AppendChild(spanH22); SpanElement spanH31 = taggedContent.CreateSpanElement(); spanH31.SetText("H3. "); h3.AppendChild(spanH31); SpanElement spanH32 = taggedContent.CreateSpanElement(); spanH32.SetText("Level 3 Header"); h3.AppendChild(spanH32); SpanElement spanH41 = taggedContent.CreateSpanElement(); spanH41.SetText("H4. "); h4.AppendChild(spanH41); SpanElement spanH42 = taggedContent.CreateSpanElement(); spanH42.SetText("Level 4 Header"); h4.AppendChild(spanH42); SpanElement spanH51 = taggedContent.CreateSpanElement(); spanH51.SetText("H5. "); h5.AppendChild(spanH51); SpanElement spanH52 = taggedContent.CreateSpanElement(); spanH52.SetText("Level 5 Header"); h5.AppendChild(spanH52); SpanElement spanH61 = taggedContent.CreateSpanElement(); spanH61.SetText("H6. "); h6.AppendChild(spanH61); SpanElement spanH62 = taggedContent.CreateSpanElement(); spanH62.SetText("Level 6 Header"); h6.AppendChild(spanH62); ParagraphElement p = taggedContent.CreateParagraphElement(); p.SetText("P. "); rootElement.AppendChild(p); SpanElement span1 = taggedContent.CreateSpanElement(); span1.SetText("Lorem ipsum dolor sit amet, consectetur adipiscing elit. "); p.AppendChild(span1); SpanElement span2 = taggedContent.CreateSpanElement(); span2.SetText("Aenean nec lectus ac sem faucibus imperdiet. "); p.AppendChild(span2); SpanElement span3 = taggedContent.CreateSpanElement(); span3.SetText("Sed ut erat ac magna ullamcorper hendrerit. "); p.AppendChild(span3); SpanElement span4 = taggedContent.CreateSpanElement(); span4.SetText("Cras pellentesque libero semper, gravida magna sed, luctus leo. "); p.AppendChild(span4); SpanElement span5 = taggedContent.CreateSpanElement(); span5.SetText("Fusce lectus odio, laoreet nec ullamcorper ut, molestie eu elit. "); p.AppendChild(span5); SpanElement span6 = taggedContent.CreateSpanElement(); span6.SetText("Interdum et malesuada fames ac ante ipsum primis in faucibus. "); p.AppendChild(span6); SpanElement span7 = taggedContent.CreateSpanElement(); span7.SetText("Aliquam lacinia sit amet elit ac consectetur. Donec cursus condimentum ligula, vitae volutpat sem tristique eget. "); p.AppendChild(span7); SpanElement span8 = taggedContent.CreateSpanElement(); span8.SetText("Nulla in consectetur massa. Vestibulum vitae lobortis ante. Nulla ullamcorper pellentesque justo rhoncus accumsan. "); p.AppendChild(span8); SpanElement span9 = taggedContent.CreateSpanElement(); span9.SetText("Mauris ornare eu odio non lacinia. Aliquam massa leo, rhoncus ac iaculis eget, tempus et magna. Sed non consectetur elit. "); p.AppendChild(span9); SpanElement span10 = taggedContent.CreateSpanElement(); span10.SetText("Sed vulputate, quam sed lacinia luctus, ipsum nibh fringilla purus, vitae posuere risus odio id massa. Cras sed venenatis lacus."); p.AppendChild(span10); // Save Tagged Pdf Document document.Save(dataDir + "InlineStructureElements.pdf");
設(shè)置自定義標(biāo)簽名稱
為了設(shè)置標(biāo)記PDF文檔的元素的自定義標(biāo)記名稱,Aspose.PDF 為元素提供了 SetTag() 方法。以下代碼段顯示了如何設(shè)置自定義標(biāo)簽名稱:
// The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdf_WorkingDocuments(); // Create Pdf Document Document document = new Document(); // Get Content for work with TaggedPdf ITaggedContent taggedContent = document.TaggedContent; // Set Title and Language for Documnet taggedContent.SetTitle("Tagged Pdf Document"); taggedContent.SetLanguage("en-US"); // Create Logical Structure Elements SectElement sect = taggedContent.CreateSectElement(); taggedContent.RootElement.AppendChild(sect); ParagraphElement p1 = taggedContent.CreateParagraphElement(); ParagraphElement p2 = taggedContent.CreateParagraphElement(); ParagraphElement p3 = taggedContent.CreateParagraphElement(); ParagraphElement p4 = taggedContent.CreateParagraphElement(); p1.SetText("P1. "); p2.SetText("P2. "); p3.SetText("P3. "); p4.SetText("P4. "); p1.SetTag("P1"); p2.SetTag("Para"); p3.SetTag("Para"); p4.SetTag("Paragraph"); sect.AppendChild(p1); sect.AppendChild(p2); sect.AppendChild(p3); sect.AppendChild(p4); SpanElement span1 = taggedContent.CreateSpanElement(); SpanElement span2 = taggedContent.CreateSpanElement(); SpanElement span3 = taggedContent.CreateSpanElement(); SpanElement span4 = taggedContent.CreateSpanElement(); span1.SetText("Span 1."); span2.SetText("Span 2."); span3.SetText("Span 3."); span4.SetText("Span 4."); span1.SetTag("SPAN"); span2.SetTag("Sp"); span3.SetTag("Sp"); span4.SetTag("TheSpan"); p1.AppendChild(span1); p2.AppendChild(span2); p3.AppendChild(span3); p4.AppendChild(span4); // Save Tagged Pdf Document document.Save(dataDir + "CustomTag.pdf");
將結(jié)構(gòu)元素添加到元素中
為了在標(biāo)記的PDF文檔中設(shè)置鏈接結(jié)構(gòu)元素,Aspose.PDF提供了ITaggedContent 接口的CreateLinkElement()方法 。以下代碼段顯示了如何在帶有標(biāo)簽PDF文檔文本的段落中設(shè)置結(jié)構(gòu)元素:
// The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdf_WorkingDocuments(); string outFile = dataDir + "LinkStructureElements_Output.pdf"; string logFile = dataDir + "46035_log.xml"; string imgFile = dataDir + "google-icon-512.png"; // Creation document and getting Tagged Pdf Content Document document = new Document(); ITaggedContent taggedContent = document.TaggedContent; // Setting Title and Nature Language for document taggedContent.SetTitle("Link Elements Example"); taggedContent.SetLanguage("en-US"); // Getting Root structure element (Document structure element) StructureElement rootElement = taggedContent.RootElement; ParagraphElement p1 = taggedContent.CreateParagraphElement(); rootElement.AppendChild(p1); LinkElement link1 = taggedContent.CreateLinkElement(); p1.AppendChild(link1); link1.Hyperlink = new WebHyperlink("http://google.com"); link1.SetText("Google"); link1.AlternateDescriptions = "Link to Google"; ParagraphElement p2 = taggedContent.CreateParagraphElement(); rootElement.AppendChild(p2); LinkElement link2 = taggedContent.CreateLinkElement(); p2.AppendChild(link2); link2.Hyperlink = new WebHyperlink("http://google.com"); SpanElement span2 = taggedContent.CreateSpanElement(); span2.SetText("Google"); link2.AppendChild(span2); link2.AlternateDescriptions = "Link to Google"; ParagraphElement p3 = taggedContent.CreateParagraphElement(); rootElement.AppendChild(p3); LinkElement link3 = taggedContent.CreateLinkElement(); p3.AppendChild(link3); link3.Hyperlink = new WebHyperlink("http://google.com"); SpanElement span31 = taggedContent.CreateSpanElement(); span31.SetText("G"); SpanElement span32 = taggedContent.CreateSpanElement(); span32.SetText("oogle"); link3.AppendChild(span31); link3.SetText("-"); link3.AppendChild(span32); link3.AlternateDescriptions = "Link to Google"; ParagraphElement p4 = taggedContent.CreateParagraphElement(); rootElement.AppendChild(p4); LinkElement link4 = taggedContent.CreateLinkElement(); p4.AppendChild(link4); link4.Hyperlink = new WebHyperlink("http://google.com"); link4.SetText("The multiline link: Google Google Google Google Google Google Google Google Google Google Google Google Google Google Google Google Google Google Google Google"); link4.AlternateDescriptions = "Link to Google (multiline)"; ParagraphElement p5 = taggedContent.CreateParagraphElement(); rootElement.AppendChild(p5); LinkElement link5 = taggedContent.CreateLinkElement(); p5.AppendChild(link5); link5.Hyperlink = new WebHyperlink("http://google.com"); FigureElement figure5 = taggedContent.CreateFigureElement(); figure5.SetImage(imgFile, 1200); figure5.AlternativeText = "Google icon"; StructureAttributes linkLayoutAttributes = link5.Attributes.GetAttributes(AttributeOwnerStandard.Layout); StructureAttribute placementAttribute = new StructureAttribute(AttributeKey.Placement); placementAttribute.SetNameValue(AttributeName.Placement_Block); linkLayoutAttributes.SetAttribute(placementAttribute); link5.AppendChild(figure5); link5.AlternateDescriptions = "Link to Google"; // Save Tagged Pdf Document document.Save(outFile); // Checking PDF/UA compliance document = new Document(outFile); bool isPdfUaCompliance = document.Validate(logFile, PdfFormat.PDF_UA_1); Console.WriteLine(String.Format("PDF/UA compliance: {0}", isPdfUaCompliance));
設(shè)置鏈接結(jié)構(gòu)元素
以下代碼段顯示了如何將鏈接結(jié)構(gòu)元素添加到帶標(biāo)簽的PDF文檔中:
// The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdf_WorkingDocuments(); string outFile = dataDir + "AddStructureElementIntoElement_Output.pdf"; string logFile = dataDir + "46144_log.xml"; // Creation document and getting Tagged Pdf Content Document document = new Document(); ITaggedContent taggedContent = document.TaggedContent; // Setting Title and Nature Language for document taggedContent.SetTitle("Text Elements Example"); taggedContent.SetLanguage("en-US"); // Getting Root structure element (Document structure element) StructureElement rootElement = taggedContent.RootElement; ParagraphElement p1 = taggedContent.CreateParagraphElement(); rootElement.AppendChild(p1); SpanElement span11 = taggedContent.CreateSpanElement(); span11.SetText("Span_11"); SpanElement span12 = taggedContent.CreateSpanElement(); span12.SetText(" and Span_12."); p1.SetText("Paragraph with "); p1.AppendChild(span11); p1.AppendChild(span12); ParagraphElement p2 = taggedContent.CreateParagraphElement(); rootElement.AppendChild(p2); SpanElement span21 = taggedContent.CreateSpanElement(); span21.SetText("Span_21"); SpanElement span22 = taggedContent.CreateSpanElement(); span22.SetText("Span_22."); p2.AppendChild(span21); p2.SetText(" and "); p2.AppendChild(span22); ParagraphElement p3 = taggedContent.CreateParagraphElement(); rootElement.AppendChild(p3); SpanElement span31 = taggedContent.CreateSpanElement(); span31.SetText("Span_31"); SpanElement span32 = taggedContent.CreateSpanElement(); span32.SetText(" and Span_32"); p3.AppendChild(span31); p3.AppendChild(span32); p3.SetText("."); ParagraphElement p4 = taggedContent.CreateParagraphElement(); rootElement.AppendChild(p4); SpanElement span41 = taggedContent.CreateSpanElement(); SpanElement span411 = taggedContent.CreateSpanElement(); span411.SetText("Span_411, "); span41.SetText("Span_41, "); span41.AppendChild(span411); SpanElement span42 = taggedContent.CreateSpanElement(); SpanElement span421 = taggedContent.CreateSpanElement(); span421.SetText("Span 421 and "); span42.AppendChild(span421); span42.SetText("Span_42"); p4.AppendChild(span41); p4.AppendChild(span42); p4.SetText("."); // Save Tagged Pdf Document document.Save(outFile); // Checking PDF/UA compliance document = new Document(outFile); bool isPdfUaCompliance = document.Validate(logFile, PdfFormat.PDF_UA_1); Console.WriteLine(String.Format("PDF/UA compliance: {0}", isPdfUaCompliance));
設(shè)置注釋結(jié)構(gòu)元素
以下代碼段顯示了如何在帶標(biāo)簽的PDF文檔中添加便箋元素:
// The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdf_WorkingDocuments(); string outFile = dataDir + "45929_doc.pdf"; string logFile = dataDir + "45929_log.xml"; // Create Pdf Document Document document = new Document(); ITaggedContent taggedContent = document.TaggedContent; taggedContent.SetTitle("Sample of Note Elements"); taggedContent.SetLanguage("en-US"); // Add Paragraph Element ParagraphElement paragraph = taggedContent.CreateParagraphElement(); taggedContent.RootElement.AppendChild(paragraph); // Add NoteElement NoteElement note1 = taggedContent.CreateNoteElement(); paragraph.AppendChild(note1); note1.SetText("Note with auto generate ID. "); // Add NoteElement NoteElement note2 = taggedContent.CreateNoteElement(); paragraph.AppendChild(note2); note2.SetText("Note with ID = 'note_002'. "); note2.SetId("note_002"); // Add NoteElement NoteElement note3 = taggedContent.CreateNoteElement(); paragraph.AppendChild(note3); note3.SetText("Note with ID = 'note_003'. "); note3.SetId("note_003"); // Must throw exception - Aspose.Pdf.Tagged.TaggedException : Structure element with ID='note_002' already exists //note3.SetId("note_002"); // Resultant document does not compliance to PDF/UA If ClearId() used for Note Structure Element //note3.ClearId(); // Save Tagged Pdf Document document.Save(outFile); // Checking PDF/UA compliance document = new Document(outFile); bool isPdfUaCompliance = document.Validate(logFile, PdfFormat.PDF_UA_1); Console.WriteLine(String.Format("PDF/UA compliance: {0}", isPdfUaCompliance));
設(shè)定語言和標(biāo)題
Aspose.PDF還允許根據(jù)規(guī)范PDF / UA設(shè)置文檔的語言和標(biāo)題??梢詾檎麄€(gè)文檔設(shè)置語言,也可以為其單獨(dú)的結(jié)構(gòu)元素設(shè)置語言。 以下代碼段顯示了如何在帶有標(biāo)簽的PDF文檔中使用語言和標(biāo)題:
Document document = new Document(); // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdf_WorkingDocuments(); // Get TaggedContent Tagged.ITaggedContent taggedContent = document.TaggedContent; // Set Title and Language taggedContent.SetTitle("Example Tagged Document"); taggedContent.SetLanguage("en-US"); // Header (en-US, inherited from document) LogicalStructure.HeaderElement h1 = taggedContent.CreateHeaderElement(1); h1.SetText("Phrase on different languages"); taggedContent.RootElement.AppendChild(h1); // Paragraph (English) LogicalStructure.ParagraphElement pEN = taggedContent.CreateParagraphElement(); pEN.SetText("Hello, World!"); pEN.Language = "en-US"; taggedContent.RootElement.AppendChild(pEN); // Paragraph (German) LogicalStructure.ParagraphElement pDE = taggedContent.CreateParagraphElement(); pDE.SetText("Hallo Welt!"); pDE.Language = "de-DE"; taggedContent.RootElement.AppendChild(pDE); // Paragraph (French) LogicalStructure.ParagraphElement pFR = taggedContent.CreateParagraphElement(); pFR.SetText("Bonjour le monde!"); pFR.Language = "fr-FR"; taggedContent.RootElement.AppendChild(pFR); // Paragraph (Spanish) LogicalStructure.ParagraphElement pSP = taggedContent.CreateParagraphElement(); pSP.SetText("?Hola Mundo!"); pSP.Language = "es-ES"; taggedContent.RootElement.AppendChild(pSP); // Save Tagged Pdf Document document.Save(dataDir + "SetupLanguageAndTitle.pdf");
還想要更多嗎?您可以點(diǎn)擊閱讀【2020 · Aspose最新資源整合】,查找需要的教程資源。如果您有任何疑問或需求,請隨時(shí)加入Aspose技術(shù)交流群(642018183),我們很高興為您提供查詢和咨詢。