原創|產品更新|編輯:李顯亮|2019-09-04 15:12:21.350|閱讀 220 次
概述:Aspose.PDF for Java更新至v19.8,新增在標記PDF中實現表格支持,支持在單個頁面中渲染所有內容,修復HTML到PDF無法解析引發的URL異常等問題。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
Aspose.PDF for Java是一種快速,輕量級的PDF處理控件,無需使用Adobe Acrobat即可生成,修改,轉換,渲染,保護和打印PDF文檔。同時支持使用PDF,XFA,TXT,HTML,PCL,XML,XPS和圖像文件格式。
Aspose.PDF for Java提供PDF壓縮選項,表格創建和操作,圖形支持,圖像功能,廣泛的超鏈接功能,擴展的安全控制和自定義字體處理。此外,開發人員可以通過其API或XML模板直接創建PDF文檔,并可以創建表單或管理PDF文檔中嵌入的表單域。
Aspose.PDF for Java更新至v19.8,新增在標記PDF中實現表格支持,支持在單個頁面中渲染所有內容,修復HTML到PDF無法解析引發的URL異常等問題。>>歡迎下載Aspose.PDF for Java最新試用版
key | 概述 | 類別 |
---|---|---|
PDFJAVA-38770 | 在單個頁面中渲染所有內容 | 新功能 |
PDFJAVA-38814 | PDF / UA:在標記PDF中實現表格支持 | 新功能 |
PDFJAVA-38771 | HTML到PDF:使用SVG渲染HTML | 增強 |
PDFJAVA-38551 | PDF到DOCX導致java.lang.IndexOutOfBoundsException | Bug修復 |
PDFJAVA-38325 | SVG到PDF - 文本沒有使用正確的字體進行渲染 | Bug修復 |
PDFJAVA-38791 | 文件處理問題 | Bug修復 |
PDFJAVA-38527 | HTML到PDF - 無法解析引發的URL異常 | Bug修復 |
PDFJAVA-38784 | 代碼在保存時拋出NullPointException | Bug修復 |
PDFJAVA-38555 | HTML到PDF - 如果圖像標記沒有值,則無法解析URL異常 | Bug修復 |
PDFJAVA-36943 | 頁面編號中的間距問題 | Bug修復 |
PDFJAVA-37360 | 將圖像插入PDF時,頁面為空白 | Bug修復 |
PDF / UA:在標記PDF中實現表格支持
使用ITaggedContent接口的createTableElement()方法創建表。要為表創建Head,Body和Foot,請使用TableElement對象的createTHead(),createTBody()和createTFoot()方法。
抽象類TableRowCollectionElement是TableTHeadElement,TableTBodyElement和TableTFootElement類的基礎。方法TableRowCollectionElement.createTR()為對應的對象創建行。
表行對象屬于TableTRElement calss。 方法TableTRElement.createTH()和TableTRElement.createTD()為相應的行創建行的單元格。 您還可以驗證所創建文檔的PDF / UA合規性。 下面的代碼段顯示了如何使用此功能。
Document document = new Document(); ITaggedContent taggedContent = document.getTaggedContent(); taggedContent.setTitle("Table example - THead, TBody, TFoot; Summary"); taggedContent.setLanguage("en-US"); StructureElement rootElement = taggedContent.getRootElement(); TableElement tableElement = taggedContent.createTableElement(); rootElement.appendChild(tableElement); TableTHeadElement tableTHeadElement = tableElement.createTHead(); TableTBodyElement tableTBodyElement = tableElement.createTBody(); TableTFootElement tableTFootElement = tableElement.createTFoot(); int rowCount = 7; int colCount = 3; int rowIndex; int colIndex; TableTRElement headTrElement = tableTHeadElement.createTR(); headTrElement.setAlternativeText("Head Row"); for (colIndex = 0; colIndex < colCount; colIndex++) { TableTHElement thElement = headTrElement.createTH(); thElement.setText("Head Cell [head row, "+colIndex+" ]"); } for (rowIndex = 0; rowIndex < rowCount; rowIndex++) { TableTRElement trElement = tableTBodyElement.createTR(); trElement.setAlternativeText("Row "+rowIndex); for (colIndex = 0; colIndex < colCount; colIndex++) { TableTDElement tdElement = trElement.createTD(); tdElement.setText("Cell ["+rowIndex+", "+colIndex+"]"); } } TableTRElement footTrElement = tableTFootElement.createTR(); footTrElement.setAlternativeText("Foot Row"); for (colIndex = 0; colIndex < colCount; colIndex++) { TableTDElement tdElement = footTrElement.createTD(); tdElement.setText("Foot Cell [foot row, "+colIndex+"]"); } StructureAttributes tableAttributes = tableElement.getAttributes().getAttributes(AttributeOwnerStandard.Table); StructureAttribute summaryAttribute = new StructureAttribute(AttributeKey.Summary); summaryAttribute.setStringValue("The summary text for table"); tableAttributes.setAttribute(summaryAttribute); // Save document document.save(dataDir+"TaggedTable_"+version+".pdf"); boolean isPdfUaCompliance = document.validate(new ByteArrayOutputStream(), PdfFormat.PDF_UA_1); System.out.println("PDF/UA compliance: "+ isPdfUaCompliance);
*想要購買Aspose正版授權的朋友可以哦~
ASPOSE技術交流QQ群(642018183)已開通,各類資源及時分享,歡迎交流討論!
掃描關注“慧聚IT”微信公眾號,及時獲取更多產品最新動態及最新資訊
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn