本文整理汇总了Java中org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem类的典型用法代码示例。如果您正苦于以下问题:Java PDOutlineItem类的具体用法?Java PDOutlineItem怎么用?Java PDOutlineItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PDOutlineItem类属于org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline包,在下文中一共展示了PDOutlineItem类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addOutlines
import org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem; //导入依赖的package包/类
private void addOutlines(Iterable<PDOutlineItem> itemCollection, PDOutlineItem rootItem,
PDDocument inDoc) throws IOException {
for (PDOutlineItem item : itemCollection) {
PDPage destPage = null;
destPage = item.findDestinationPage(inDoc);
PDOutlineItem outItem = new PDOutlineItem();
if (destPage != null) {
PDPage itemDestPage =
outDocument.getPages().get(inDoc.getPages().indexOf(destPage) + outPagesN);
outItem.setDestination(itemDestPage);
}
outItem.setTitle(item.getTitle());
rootItem.addLast(outItem);
if (item.hasChildren())
addOutlines(item.children(), outItem, inDoc);
}
}
开发者ID:Yanpas,项目名称:PdfMerger,代码行数:19,代码来源:Merger.java
示例2: sanitizeDocumentOutlineItem
import org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem; //导入依赖的package包/类
private void sanitizeDocumentOutlineItem(BleachSession session, PDOutlineItem item) {
if (item.getAction() == null)
return;
LOGGER.debug("Found&removed action on outline item (was {})", item.getAction());
item.setAction(null);
recordJavascriptThreat(session, "DocumentOutline Item Action", "Action");
}
开发者ID:docbleach,项目名称:DocBleach,代码行数:8,代码来源:PdfBleach.java
示例3: bookmark
import org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem; //导入依赖的package包/类
private PDOutlineItem bookmark(PDOutlineNode outline, String etiqueta) {
PDOutlineItem current = outline.getFirstChild();
while (current != null) {
if (current.getTitle().equals(etiqueta)) {
return current;
}
bookmark(current, etiqueta);
current = current.getNextSibling();
}
return current;
}
开发者ID:mkl-public,项目名称:testarea-pdfbox2,代码行数:12,代码来源:MergeDocuments.java
示例4: appendDoc
import org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem; //导入依赖的package包/类
private void appendDoc(final File inFile) throws IOException {
try {
inDocuments.push(PDDocument.load(inFile));
} catch (IOException e) {
throw new IOException("File \"" + inFile.getAbsolutePath() + "\" seems to be non-pdf");
}
PDDocument inDoc = inDocuments.peek();
int inPagesN = inDoc.getNumberOfPages();
if (inPagesN < 1)
return;
String finname = inFile.getName();
if (finname.length() > 4)
finname = finname.substring(0,finname.length()-4);
PDDocumentOutline inOutline = inDoc.getDocumentCatalog().getDocumentOutline();
for (int i=0; i<inPagesN; ++i)
outDocument.addPage(inDoc.getPage(i));
PDOutlineItem outRoot = new PDOutlineItem();
outRoot.setTitle(finname);
outRoot.setDestination(outDocument.getPages().get(outPagesN));
outOutline.addLast(outRoot);
if (inOutline != null)
addOutlines(inOutline.children(), outRoot, inDoc);
outPagesN += inPagesN;
}
开发者ID:Yanpas,项目名称:PdfMerger,代码行数:30,代码来源:Merger.java
示例5: getPageNumber
import org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem; //导入依赖的package包/类
private int getPageNumber( PDOutlineItem bookmark, List<COSObjectable> allPages ) throws IOException
{
int pageNumber = -1;
PDPage page = bookmark.findDestinationPage( document );
if( page != null )
{
pageNumber = allPages.indexOf( page )+1;//use one based indexing
}
return pageNumber;
}
开发者ID:hemangandhi,项目名称:my-cv-site,代码行数:11,代码来源:FormattedReader.java
示例6: extractBookmarkText
import org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem; //导入依赖的package包/类
void extractBookmarkText(PDOutlineNode bookmark) throws SAXException {
PDOutlineItem current = bookmark.getFirstChild();
if (current != null) {
handler.startElement("ul");
while (current != null) {
handler.startElement("li");
handler.characters(current.getTitle());
handler.endElement("li");
// Recurse:
extractBookmarkText(current);
current = current.getNextSibling();
}
handler.endElement("ul");
}
}
开发者ID:kolbasa,项目名称:OCRaptor,代码行数:16,代码来源:PDF2XHTML.java
示例7: addBookmarks
import org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem; //导入依赖的package包/类
@Override
public void addBookmarks(final String inputUri, final String outputUri, final String title,
final List<PDFGalBookmark> pdfGalBookmarksList) throws IOException, COSVisitorException {
if (StringUtils.isNotBlank(inputUri) && StringUtils.isNotBlank(outputUri)
&& StringUtils.isNotEmpty(title) && CollectionUtils.isNotEmpty(pdfGalBookmarksList)) {
final PDDocument doc = PDDocument.load(inputUri);
final PDDocumentOutline outline = new PDDocumentOutline();
doc.getDocumentCatalog().setDocumentOutline(outline);
final PDOutlineItem pagesOutline = new PDOutlineItem();
pagesOutline.setTitle(title);
@SuppressWarnings("unchecked")
final List<PDPage> pages = doc.getDocumentCatalog().getAllPages();
outline.appendChild(pagesOutline);
for (final PDFGalBookmark pdfGalBookmark : pdfGalBookmarksList) {
if (pdfGalBookmark != null && pdfGalBookmark.isInitializated()) {
final PDPage page = pages.get(pdfGalBookmark.getPage() - 1);
final PDPageFitWidthDestination dest = new PDPageFitWidthDestination();
dest.setPage(page);
final PDOutlineItem bookmark = new PDOutlineItem();
bookmark.setDestination(dest);
bookmark.setTitle(pdfGalBookmark.getText());
pagesOutline.appendChild(bookmark);
}
}
pagesOutline.openNode();
outline.openNode();
doc.save(outputUri);
doc.close();
} else {
throw new IllegalArgumentException(Constants.ILLEGAL_ARGUMENT_EXCEPTION_MESSAGE);
}
}
开发者ID:alexpernas,项目名称:PDFGal,代码行数:39,代码来源:PDFGalImpl.java
示例8: getPageNumber
import org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem; //导入依赖的package包/类
private int getPageNumber(PDOutlineItem bookmark, List<COSObjectable> allPages) throws IOException
{
int pageNumber = -1;
PDPage page = bookmark.findDestinationPage(document);
if (page != null)
{
pageNumber = allPages.indexOf(page) + 1;//use one based indexing
}
return pageNumber;
}
开发者ID:nemausus,项目名称:research-paper-parser,代码行数:11,代码来源:PDFParser.java
示例9: currentPageNumber
import org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem; //导入依赖的package包/类
protected int currentPageNumber( PDOutlineItem bookmark, List allPages ) throws IOException
{
int pageNumber = -1;
PDPage page = bookmark.findDestinationPage( document );
if( page != null )
{
pageNumber = allPages.indexOf( page )+1;//use one based indexing
}
return pageNumber;
}
开发者ID:tamirhassan,项目名称:pdfxtk,代码行数:11,代码来源:PDFObjectExtractor.java
示例10: getEndBookmark
import org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem; //导入依赖的package包/类
PDOutlineItem getEndBookmark()
{
return endBookmark;
}
开发者ID:nemausus,项目名称:research-paper-parser,代码行数:5,代码来源:PDFParser.java
示例11: setEndBookmark
import org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem; //导入依赖的package包/类
void setEndBookmark(PDOutlineItem aEndBookmark)
{
endBookmark = aEndBookmark;
}
开发者ID:nemausus,项目名称:research-paper-parser,代码行数:5,代码来源:PDFParser.java
示例12: getStartBookmark
import org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem; //导入依赖的package包/类
PDOutlineItem getStartBookmark()
{
return startBookmark;
}
开发者ID:nemausus,项目名称:research-paper-parser,代码行数:5,代码来源:PDFParser.java
示例13: setStartBookmark
import org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem; //导入依赖的package包/类
void setStartBookmark(PDOutlineItem aStartBookmark)
{
startBookmark = aStartBookmark;
}
开发者ID:nemausus,项目名称:research-paper-parser,代码行数:5,代码来源:PDFParser.java
示例14: getEndBookmark
import org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem; //导入依赖的package包/类
/**
* Get the bookmark where text extraction should end, inclusive. Default is null.
*
* @return The ending bookmark.
*/
public PDOutlineItem getEndBookmark()
{
return endBookmark;
}
开发者ID:hemangandhi,项目名称:my-cv-site,代码行数:10,代码来源:FormattedReader.java
示例15: setEndBookmark
import org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem; //导入依赖的package包/类
/**
* Set the bookmark where the text extraction should stop.
*
* @param aEndBookmark The ending bookmark.
*/
public void setEndBookmark(PDOutlineItem aEndBookmark)
{
endBookmark = aEndBookmark;
}
开发者ID:hemangandhi,项目名称:my-cv-site,代码行数:10,代码来源:FormattedReader.java
示例16: getStartBookmark
import org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem; //导入依赖的package包/类
/**
* Get the bookmark where text extraction should start, inclusive. Default is null.
*
* @return The starting bookmark.
*/
public PDOutlineItem getStartBookmark()
{
return startBookmark;
}
开发者ID:hemangandhi,项目名称:my-cv-site,代码行数:10,代码来源:FormattedReader.java
示例17: setStartBookmark
import org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem; //导入依赖的package包/类
/**
* Set the bookmark where text extraction should start, inclusive.
*
* @param aStartBookmark The starting bookmark.
*/
public void setStartBookmark(PDOutlineItem aStartBookmark)
{
startBookmark = aStartBookmark;
}
开发者ID:hemangandhi,项目名称:my-cv-site,代码行数:10,代码来源:FormattedReader.java
注:本文中的org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论