原創(chuàng)|產(chǎn)品更新|編輯:李顯亮|2019-09-04 15:12:21.350|閱讀 226 次
概述:Aspose.PDF for Java更新至v19.8,新增在標(biāo)記PDF中實(shí)現(xiàn)表格支持,支持在單個(gè)頁(yè)面中渲染所有內(nèi)容,修復(fù)HTML到PDF無(wú)法解析引發(fā)的URL異常等問(wèn)題。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
Aspose.PDF for Java是一種快速,輕量級(jí)的PDF處理控件,無(wú)需使用Adobe Acrobat即可生成,修改,轉(zhuǎn)換,渲染,保護(hù)和打印PDF文檔。同時(shí)支持使用PDF,XFA,TXT,HTML,PCL,XML,XPS和圖像文件格式。
Aspose.PDF for Java提供PDF壓縮選項(xiàng),表格創(chuàng)建和操作,圖形支持,圖像功能,廣泛的超鏈接功能,擴(kuò)展的安全控制和自定義字體處理。此外,開(kāi)發(fā)人員可以通過(guò)其API或XML模板直接創(chuàng)建PDF文檔,并可以創(chuàng)建表單或管理PDF文檔中嵌入的表單域。
Aspose.PDF for Java更新至v19.8,新增在標(biāo)記PDF中實(shí)現(xiàn)表格支持,支持在單個(gè)頁(yè)面中渲染所有內(nèi)容,修復(fù)HTML到PDF無(wú)法解析引發(fā)的URL異常等問(wèn)題。>>歡迎下載Aspose.PDF for Java最新試用版
| key | 概述 | 類別 |
|---|---|---|
| PDFJAVA-38770 | 在單個(gè)頁(yè)面中渲染所有內(nèi)容 | 新功能 |
| PDFJAVA-38814 | PDF / UA:在標(biāo)記PDF中實(shí)現(xiàn)表格支持 | 新功能 |
| PDFJAVA-38771 | HTML到PDF:使用SVG渲染HTML | 增強(qiáng) |
| PDFJAVA-38551 | PDF到DOCX導(dǎo)致java.lang.IndexOutOfBoundsException | Bug修復(fù) |
| PDFJAVA-38325 | SVG到PDF - 文本沒(méi)有使用正確的字體進(jìn)行渲染 | Bug修復(fù) |
| PDFJAVA-38791 | 文件處理問(wèn)題 | Bug修復(fù) |
| PDFJAVA-38527 | HTML到PDF - 無(wú)法解析引發(fā)的URL異常 | Bug修復(fù) |
| PDFJAVA-38784 | 代碼在保存時(shí)拋出NullPointException | Bug修復(fù) |
| PDFJAVA-38555 | HTML到PDF - 如果圖像標(biāo)記沒(méi)有值,則無(wú)法解析URL異常 | Bug修復(fù) |
| PDFJAVA-36943 | 頁(yè)面編號(hào)中的間距問(wèn)題 | Bug修復(fù) |
| PDFJAVA-37360 | 將圖像插入PDF時(shí),頁(yè)面為空白 | Bug修復(fù) |
PDF / UA:在標(biāo)記PDF中實(shí)現(xiàn)表格支持
使用ITaggedContent接口的createTableElement()方法創(chuàng)建表。要為表創(chuàng)建Head,Body和Foot,請(qǐng)使用TableElement對(duì)象的createTHead(),createTBody()和createTFoot()方法。
抽象類TableRowCollectionElement是TableTHeadElement,TableTBodyElement和TableTFootElement類的基礎(chǔ)。方法TableRowCollectionElement.createTR()為對(duì)應(yīng)的對(duì)象創(chuàng)建行。
表行對(duì)象屬于TableTRElement calss。 方法TableTRElement.createTH()和TableTRElement.createTD()為相應(yīng)的行創(chuàng)建行的單元格。 您還可以驗(yàn)證所創(chuàng)建文檔的PDF / UA合規(guī)性。 下面的代碼段顯示了如何使用此功能。
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);*想要購(gòu)買Aspose正版授權(quán)的朋友可以哦~
ASPOSE技術(shù)交流QQ群(642018183)已開(kāi)通,各類資源及時(shí)分享,歡迎交流討論!
掃描關(guān)注“慧聚IT”微信公眾號(hào),及時(shí)獲取更多產(chǎn)品最新動(dòng)態(tài)及最新資訊

本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@ke049m.cn