@Override protected void startDocument(PDDocument pdf) throws IOException { try { xhtml.startDocument(); try { handleDestinationOrAction(pdf.getDocumentCatalog().getOpenAction(), ActionTrigger.DOCUMENT_OPEN); } catch (IOException e) { //See PDFBOX-3773 //swallow -- no need to report this } } catch (TikaException|SAXException e) { throw new IOExceptionWithCause("Unable to start a document", e); } }
private List<PDAction> getOpenAction() { if (this.catalog != null) { try { PDDestinationOrAction openAction = this.catalog.getOpenAction(); if (openAction instanceof org.apache.pdfbox.pdmodel.interactive.action.PDAction) { List<PDAction> actions = new ArrayList<>(MAX_NUMBER_OF_ELEMENTS); this.addAction(actions, (org.apache.pdfbox.pdmodel.interactive.action.PDAction) openAction); return Collections.unmodifiableList(actions); } } catch (IOException e) { LOGGER.debug( "Problems with open action obtaining. " + e.getMessage(), e); } } return Collections.emptyList(); }
void sanitizeOpenAction(PDDocumentCatalog docCatalog) throws IOException { LOGGER.trace("Checking OpenAction..."); PDDestinationOrAction openAction = docCatalog.getOpenAction(); if (openAction == null) { return; } LOGGER.debug("Found a JavaScript OpenAction, removed. Was {}", openAction); docCatalog.setOpenAction(null); pdfBleachSession.recordJavascriptThreat("Document Catalog", "OpenAction"); }
if (destCatalog.getOpenAction() == null) try openAction = srcCatalog.getOpenAction(); PDDestinationOrAction openAction = destCatalog.getOpenAction(); PDPageDestination pageDestination; if (openAction instanceof PDActionGoTo)
@Override protected void startDocument(PDDocument pdf) throws IOException { try { xhtml.startDocument(); handleDestinationOrAction(pdf.getDocumentCatalog().getOpenAction(), ActionTrigger.DOCUMENT_OPEN); } catch (TikaException|SAXException e) { throw new IOExceptionWithCause("Unable to start a document", e); } }
@Override protected void startDocument(PDDocument pdf) throws IOException { try { xhtml.startDocument(); handleDestinationOrAction(pdf.getDocumentCatalog().getOpenAction(), ActionTrigger.DOCUMENT_OPEN); } catch (TikaException|SAXException e) { throw new IOExceptionWithCause("Unable to start a document", e); } }
@Override protected void startDocument(PDDocument pdf) throws IOException { try { xhtml.startDocument(); try { handleDestinationOrAction(pdf.getDocumentCatalog().getOpenAction(), ActionTrigger.DOCUMENT_OPEN); } catch (IOException e) { //See PDFBOX-3773 //swallow -- no need to report this } } catch (TikaException|SAXException e) { throw new IOExceptionWithCause("Unable to start a document", e); } }
if (destCatalog.getOpenAction() == null) PDDestinationOrAction openAction = srcCatalog.getOpenAction(); PDDestination openActionDestination; if (openAction instanceof PDActionGoTo) destCatalog.setOpenAction(srcCatalog.getOpenAction()); PDDestinationOrAction openAction = destCatalog.getOpenAction(); PDPageDestination pageDestination; if (destCatalog.getOpenAction() instanceof PDActionGoTo)
if (destCatalog.getOpenAction() == null) try openAction = srcCatalog.getOpenAction(); PDDestinationOrAction openAction = destCatalog.getOpenAction(); PDPageDestination pageDestination; if (openAction instanceof PDActionGoTo)