Search in sources :

Example 31 with PDResources

use of com.tom_roush.pdfbox.pdmodel.PDResources in project PdfBox-Android by TomRoush.

the class TestLayerUtility method createMainPDF.

private File createMainPDF() throws IOException {
    File targetFile = new File(testResultsDir, "text-doc.pdf");
    PDDocument doc = new PDDocument();
    try {
        // Create new page
        PDPage page = new PDPage();
        doc.addPage(page);
        PDResources resources = page.getResources();
        if (resources == null) {
            resources = new PDResources();
            page.setResources(resources);
        }
        final String[] text = new String[] { "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer fermentum lacus in eros", "condimentum eget tristique risus viverra. Sed ac sem et lectus ultrices placerat. Nam", "fringilla tincidunt nulla id euismod. Vivamus eget mauris dui. Mauris luctus ullamcorper", "leo, et laoreet diam suscipit et. Nulla viverra commodo sagittis. Integer vitae rhoncus velit.", "Mauris porttitor ipsum in est sagittis non luctus purus molestie. Sed placerat aliquet", "vulputate." };
        // Setup page content stream and paint background/title
        PDPageContentStream contentStream = new PDPageContentStream(doc, page, PDPageContentStream.AppendMode.OVERWRITE, false);
        PDFont font = PDType1Font.HELVETICA_BOLD;
        contentStream.beginText();
        contentStream.newLineAtOffset(50, 720);
        contentStream.setFont(font, 14);
        contentStream.showText("Simple test document with text.");
        contentStream.endText();
        font = PDType1Font.HELVETICA;
        contentStream.beginText();
        int fontSize = 12;
        contentStream.setFont(font, fontSize);
        contentStream.newLineAtOffset(50, 700);
        for (String line : text) {
            contentStream.newLineAtOffset(0, -fontSize * 1.2f);
            contentStream.showText(line);
        }
        contentStream.endText();
        contentStream.close();
        doc.save(targetFile.getAbsolutePath());
    } finally {
        doc.close();
    }
    return targetFile;
}
Also used : PDFont(com.tom_roush.pdfbox.pdmodel.font.PDFont) PDPage(com.tom_roush.pdfbox.pdmodel.PDPage) PDDocument(com.tom_roush.pdfbox.pdmodel.PDDocument) PDResources(com.tom_roush.pdfbox.pdmodel.PDResources) PDPageContentStream(com.tom_roush.pdfbox.pdmodel.PDPageContentStream) File(java.io.File)

Example 32 with PDResources

use of com.tom_roush.pdfbox.pdmodel.PDResources in project PdfBox-Android by TomRoush.

the class TestLayerUtility method createOverlay1.

private File createOverlay1() throws IOException {
    File targetFile = new File(testResultsDir, "overlay1.pdf");
    PDDocument doc = new PDDocument();
    try {
        // Create new page
        PDPage page = new PDPage();
        doc.addPage(page);
        PDResources resources = page.getResources();
        if (resources == null) {
            resources = new PDResources();
            page.setResources(resources);
        }
        // Setup page content stream and paint background/title
        PDPageContentStream contentStream = new PDPageContentStream(doc, page, PDPageContentStream.AppendMode.OVERWRITE, false);
        PDFont font = PDType1Font.HELVETICA_BOLD;
        contentStream.setNonStrokingColor(AWTColor.LIGHT_GRAY);
        contentStream.beginText();
        float fontSize = 96;
        contentStream.setFont(font, fontSize);
        String text = "OVERLAY";
        // float sw = font.getStringWidth(text);
        // Too bad, base 14 fonts don't return character metrics.
        PDRectangle crop = page.getCropBox();
        float cx = crop.getWidth() / 2f;
        float cy = crop.getHeight() / 2f;
        Matrix transform = new Matrix();
        transform.translate(cx, cy);
        transform.rotate(Math.toRadians(45));
        transform.translate(-190, /* sw/2 */
        0);
        contentStream.setTextMatrix(transform);
        contentStream.showText(text);
        contentStream.endText();
        contentStream.close();
        doc.save(targetFile.getAbsolutePath());
    } finally {
        doc.close();
    }
    return targetFile;
}
Also used : PDFont(com.tom_roush.pdfbox.pdmodel.font.PDFont) Matrix(com.tom_roush.pdfbox.util.Matrix) PDPage(com.tom_roush.pdfbox.pdmodel.PDPage) PDDocument(com.tom_roush.pdfbox.pdmodel.PDDocument) PDResources(com.tom_roush.pdfbox.pdmodel.PDResources) PDPageContentStream(com.tom_roush.pdfbox.pdmodel.PDPageContentStream) PDRectangle(com.tom_roush.pdfbox.pdmodel.common.PDRectangle) File(java.io.File)

Example 33 with PDResources

use of com.tom_roush.pdfbox.pdmodel.PDResources in project PdfBox-Android by TomRoush.

the class PDFMergerUtility method appendDocument.

/**
 * append all pages from source to destination.
 *
 * @param destination the document to receive the pages
 * @param source the document originating the new pages
 *
 * @throws IOException If there is an error accessing data from either
 * document.
 */
public void appendDocument(PDDocument destination, PDDocument source) throws IOException {
    if (source.getDocument().isClosed()) {
        throw new IOException("Error: source PDF is closed.");
    }
    if (destination.getDocument().isClosed()) {
        throw new IOException("Error: destination PDF is closed.");
    }
    PDDocumentCatalog destCatalog = destination.getDocumentCatalog();
    PDDocumentCatalog srcCatalog = source.getDocumentCatalog();
    if (isDynamicXfa(srcCatalog.getAcroForm())) {
        throw new IOException("Error: can't merge source document containing dynamic XFA form content.");
    }
    PDDocumentInformation destInfo = destination.getDocumentInformation();
    PDDocumentInformation srcInfo = source.getDocumentInformation();
    mergeInto(srcInfo.getCOSObject(), destInfo.getCOSObject(), Collections.<COSName>emptySet());
    // use the highest version number for the resulting pdf
    float destVersion = destination.getVersion();
    float srcVersion = source.getVersion();
    if (destVersion < srcVersion) {
        destination.setVersion(srcVersion);
    }
    int pageIndexOpenActionDest = -1;
    if (destCatalog.getOpenAction() == null) {
        // PDFBOX-3972: get local dest page index, it must be reassigned after the page cloning
        PDDestinationOrAction openAction = null;
        try {
            openAction = srcCatalog.getOpenAction();
        } catch (IOException ex) {
            // PDFBOX-4223
            Log.e("PdfBox-Android", "Invalid OpenAction ignored", ex);
        }
        PDDestination openActionDestination = null;
        if (openAction instanceof PDActionGoTo) {
            openActionDestination = ((PDActionGoTo) openAction).getDestination();
        } else if (openAction instanceof PDDestination) {
            openActionDestination = (PDDestination) openAction;
        }
        if (openActionDestination instanceof PDPageDestination) {
            PDPage page = ((PDPageDestination) openActionDestination).getPage();
            if (page != null) {
                pageIndexOpenActionDest = srcCatalog.getPages().indexOf(page);
            }
        }
        destCatalog.setOpenAction(openAction);
    }
    PDFCloneUtility cloner = new PDFCloneUtility(destination);
    mergeAcroForm(cloner, destCatalog, srcCatalog);
    COSArray destThreads = (COSArray) destCatalog.getCOSObject().getDictionaryObject(COSName.THREADS);
    COSArray srcThreads = (COSArray) cloner.cloneForNewDocument(destCatalog.getCOSObject().getDictionaryObject(COSName.THREADS));
    if (destThreads == null) {
        destCatalog.getCOSObject().setItem(COSName.THREADS, srcThreads);
    } else {
        destThreads.addAll(srcThreads);
    }
    PDDocumentNameDictionary destNames = destCatalog.getNames();
    PDDocumentNameDictionary srcNames = srcCatalog.getNames();
    if (srcNames != null) {
        if (destNames == null) {
            destCatalog.getCOSObject().setItem(COSName.NAMES, cloner.cloneForNewDocument(srcNames));
        } else {
            cloner.cloneMerge(srcNames, destNames);
        }
    }
    if (destNames != null) {
        // found in 054080.pdf from PDFBOX-4417 and doesn't belong there
        destNames.getCOSObject().removeItem(COSName.ID_TREE);
        Log.w("PdfBox-Android", "Removed /IDTree from /Names dictionary, doesn't belong there");
    }
    PDDocumentNameDestinationDictionary destDests = destCatalog.getDests();
    PDDocumentNameDestinationDictionary srcDests = srcCatalog.getDests();
    if (srcDests != null) {
        if (destDests == null) {
            destCatalog.getCOSObject().setItem(COSName.DESTS, cloner.cloneForNewDocument(srcDests));
        } else {
            cloner.cloneMerge(srcDests, destDests);
        }
    }
    PDDocumentOutline destOutline = destCatalog.getDocumentOutline();
    PDDocumentOutline srcOutline = srcCatalog.getDocumentOutline();
    if (srcOutline != null) {
        if (destOutline == null || destOutline.getFirstChild() == null) {
            PDDocumentOutline cloned = new PDDocumentOutline((COSDictionary) cloner.cloneForNewDocument(srcOutline));
            destCatalog.setDocumentOutline(cloned);
        } else {
            // search last sibling for dest, because /Last entry is sometimes wrong
            PDOutlineItem destLastOutlineItem = destOutline.getFirstChild();
            while (destLastOutlineItem.getNextSibling() != null) {
                destLastOutlineItem = destLastOutlineItem.getNextSibling();
            }
            for (PDOutlineItem item : srcOutline.children()) {
                // get each child, clone its dictionary, remove siblings info,
                // append outline item created from there
                COSDictionary clonedDict = (COSDictionary) cloner.cloneForNewDocument(item);
                clonedDict.removeItem(COSName.PREV);
                clonedDict.removeItem(COSName.NEXT);
                PDOutlineItem clonedItem = new PDOutlineItem(clonedDict);
                destLastOutlineItem.insertSiblingAfter(clonedItem);
                destLastOutlineItem = destLastOutlineItem.getNextSibling();
            }
        }
    }
    PageMode destPageMode = destCatalog.getPageMode();
    PageMode srcPageMode = srcCatalog.getPageMode();
    if (destPageMode == null) {
        destCatalog.setPageMode(srcPageMode);
    }
    COSDictionary destLabels = destCatalog.getCOSObject().getCOSDictionary(COSName.PAGE_LABELS);
    COSDictionary srcLabels = srcCatalog.getCOSObject().getCOSDictionary(COSName.PAGE_LABELS);
    if (srcLabels != null) {
        int destPageCount = destination.getNumberOfPages();
        COSArray destNums;
        if (destLabels == null) {
            destLabels = new COSDictionary();
            destNums = new COSArray();
            destLabels.setItem(COSName.NUMS, destNums);
            destCatalog.getCOSObject().setItem(COSName.PAGE_LABELS, destLabels);
        } else {
            destNums = (COSArray) destLabels.getDictionaryObject(COSName.NUMS);
        }
        COSArray srcNums = (COSArray) srcLabels.getDictionaryObject(COSName.NUMS);
        if (srcNums != null) {
            int startSize = destNums.size();
            for (int i = 0; i < srcNums.size(); i += 2) {
                COSBase base = srcNums.getObject(i);
                if (!(base instanceof COSNumber)) {
                    Log.e("PdfBox-Android", "page labels ignored, index " + i + " should be a number, but is " + base);
                    // remove what we added
                    while (destNums.size() > startSize) {
                        destNums.remove(startSize);
                    }
                    break;
                }
                COSNumber labelIndex = (COSNumber) base;
                long labelIndexValue = labelIndex.intValue();
                destNums.add(COSInteger.get(labelIndexValue + destPageCount));
                destNums.add(cloner.cloneForNewDocument(srcNums.getObject(i + 1)));
            }
        }
    }
    COSStream destMetadata = destCatalog.getCOSObject().getCOSStream(COSName.METADATA);
    COSStream srcMetadata = srcCatalog.getCOSObject().getCOSStream(COSName.METADATA);
    if (destMetadata == null && srcMetadata != null) {
        try {
            PDStream newStream = new PDStream(destination, srcMetadata.createInputStream(), (COSName) null);
            mergeInto(srcMetadata, newStream.getCOSObject(), new HashSet<COSName>(Arrays.asList(COSName.FILTER, COSName.LENGTH)));
            destCatalog.getCOSObject().setItem(COSName.METADATA, newStream);
        } catch (IOException ex) {
            // PDFBOX-4227 cleartext XMP stream with /Flate
            Log.e("PdfBox-Android", "Metadata skipped because it could not be read", ex);
        }
    }
    COSDictionary destOCP = destCatalog.getCOSObject().getCOSDictionary(COSName.OCPROPERTIES);
    COSDictionary srcOCP = srcCatalog.getCOSObject().getCOSDictionary(COSName.OCPROPERTIES);
    if (destOCP == null && srcOCP != null) {
        destCatalog.getCOSObject().setItem(COSName.OCPROPERTIES, cloner.cloneForNewDocument(srcOCP));
    } else if (destOCP != null && srcOCP != null) {
        cloner.cloneMerge(srcOCP, destOCP);
    }
    mergeOutputIntents(cloner, srcCatalog, destCatalog);
    // merge logical structure hierarchy
    boolean mergeStructTree = false;
    int destParentTreeNextKey = -1;
    Map<Integer, COSObjectable> srcNumberTreeAsMap = null;
    Map<Integer, COSObjectable> destNumberTreeAsMap = null;
    PDStructureTreeRoot srcStructTree = srcCatalog.getStructureTreeRoot();
    PDStructureTreeRoot destStructTree = destCatalog.getStructureTreeRoot();
    if (destStructTree == null && srcStructTree != null) {
        // create a dummy structure tree in the destination, so that the source
        // tree is cloned. (We can't just copy the tree reference due to PDFBOX-3999)
        destStructTree = new PDStructureTreeRoot();
        destCatalog.setStructureTreeRoot(destStructTree);
        destStructTree.setParentTree(new PDNumberTreeNode(PDParentTreeValue.class));
        // PDFBOX-4429: remove bogus StructParent(s)
        for (PDPage page : destCatalog.getPages()) {
            page.getCOSObject().removeItem(COSName.STRUCT_PARENTS);
            for (PDAnnotation ann : page.getAnnotations()) {
                ann.getCOSObject().removeItem(COSName.STRUCT_PARENT);
            }
        }
    }
    if (destStructTree != null) {
        PDNumberTreeNode destParentTree = destStructTree.getParentTree();
        destParentTreeNextKey = destStructTree.getParentTreeNextKey();
        if (destParentTree != null) {
            destNumberTreeAsMap = getNumberTreeAsMap(destParentTree);
            if (destParentTreeNextKey < 0) {
                if (destNumberTreeAsMap.isEmpty()) {
                    destParentTreeNextKey = 0;
                } else {
                    destParentTreeNextKey = Collections.max(destNumberTreeAsMap.keySet()) + 1;
                }
            }
            if (destParentTreeNextKey >= 0 && srcStructTree != null) {
                PDNumberTreeNode srcParentTree = srcStructTree.getParentTree();
                if (srcParentTree != null) {
                    srcNumberTreeAsMap = getNumberTreeAsMap(srcParentTree);
                    if (!srcNumberTreeAsMap.isEmpty()) {
                        mergeStructTree = true;
                    }
                }
            }
        }
    }
    Map<COSDictionary, COSDictionary> objMapping = new HashMap<COSDictionary, COSDictionary>();
    int pageIndex = 0;
    for (PDPage page : srcCatalog.getPages()) {
        PDPage newPage = new PDPage((COSDictionary) cloner.cloneForNewDocument(page.getCOSObject()));
        if (!mergeStructTree) {
            // PDFBOX-4429: remove bogus StructParent(s)
            newPage.getCOSObject().removeItem(COSName.STRUCT_PARENTS);
            for (PDAnnotation ann : newPage.getAnnotations()) {
                ann.getCOSObject().removeItem(COSName.STRUCT_PARENT);
            }
        }
        newPage.setCropBox(page.getCropBox());
        newPage.setMediaBox(page.getMediaBox());
        newPage.setRotation(page.getRotation());
        PDResources resources = page.getResources();
        if (resources != null) {
            // this is smart enough to just create references for resources that are used on multiple pages
            newPage.setResources(new PDResources((COSDictionary) cloner.cloneForNewDocument(resources)));
        } else {
            newPage.setResources(new PDResources());
        }
        if (mergeStructTree) {
            // add the value of the destination ParentTreeNextKey to every source element
            // StructParent(s) value so that these don't overlap with the existing values
            updateStructParentEntries(newPage, destParentTreeNextKey);
            objMapping.put(page.getCOSObject(), newPage.getCOSObject());
            List<PDAnnotation> oldAnnots = page.getAnnotations();
            List<PDAnnotation> newAnnots = newPage.getAnnotations();
            for (int i = 0; i < oldAnnots.size(); i++) {
                objMapping.put(oldAnnots.get(i).getCOSObject(), newAnnots.get(i).getCOSObject());
            }
        // TODO update mapping for XObjects
        }
        destination.addPage(newPage);
        if (pageIndex == pageIndexOpenActionDest) {
            // PDFBOX-3972: reassign the page.
            // The openAction is either a PDActionGoTo or a PDPageDestination
            PDDestinationOrAction openAction = destCatalog.getOpenAction();
            PDPageDestination pageDestination;
            if (openAction instanceof PDActionGoTo) {
                pageDestination = (PDPageDestination) ((PDActionGoTo) openAction).getDestination();
            } else {
                pageDestination = (PDPageDestination) openAction;
            }
            pageDestination.setPage(newPage);
        }
        ++pageIndex;
    }
    if (mergeStructTree) {
        updatePageReferences(cloner, srcNumberTreeAsMap, objMapping);
        int maxSrcKey = -1;
        for (Map.Entry<Integer, COSObjectable> entry : srcNumberTreeAsMap.entrySet()) {
            int srcKey = entry.getKey();
            maxSrcKey = Math.max(srcKey, maxSrcKey);
            destNumberTreeAsMap.put(destParentTreeNextKey + srcKey, cloner.cloneForNewDocument(entry.getValue()));
        }
        destParentTreeNextKey += maxSrcKey + 1;
        PDNumberTreeNode newParentTreeNode = new PDNumberTreeNode(PDParentTreeValue.class);
        // Note that all elements are stored flatly. This could become a problem for large files
        // when these are opened in a viewer that uses the tagging information.
        // If this happens, then ​PDNumberTreeNode should be improved with a convenience method that
        // stores the map into a B+Tree, see https://en.wikipedia.org/wiki/B+_tree
        newParentTreeNode.setNumbers(destNumberTreeAsMap);
        destStructTree.setParentTree(newParentTreeNode);
        destStructTree.setParentTreeNextKey(destParentTreeNextKey);
        mergeKEntries(cloner, srcStructTree, destStructTree);
        mergeRoleMap(srcStructTree, destStructTree);
        mergeIDTree(cloner, srcStructTree, destStructTree);
        mergeMarkInfo(destCatalog, srcCatalog);
        mergeLanguage(destCatalog, srcCatalog);
        mergeViewerPreferences(destCatalog, srcCatalog);
    }
}
Also used : COSStream(com.tom_roush.pdfbox.cos.COSStream) PDPage(com.tom_roush.pdfbox.pdmodel.PDPage) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) PDDestinationOrAction(com.tom_roush.pdfbox.pdmodel.common.PDDestinationOrAction) PDStructureTreeRoot(com.tom_roush.pdfbox.pdmodel.documentinterchange.logicalstructure.PDStructureTreeRoot) PDPageDestination(com.tom_roush.pdfbox.pdmodel.interactive.documentnavigation.destination.PDPageDestination) COSObjectable(com.tom_roush.pdfbox.pdmodel.common.COSObjectable) PDNumberTreeNode(com.tom_roush.pdfbox.pdmodel.common.PDNumberTreeNode) COSArray(com.tom_roush.pdfbox.cos.COSArray) COSName(com.tom_roush.pdfbox.cos.COSName) COSNumber(com.tom_roush.pdfbox.cos.COSNumber) COSBase(com.tom_roush.pdfbox.cos.COSBase) PDDocumentInformation(com.tom_roush.pdfbox.pdmodel.PDDocumentInformation) PDActionGoTo(com.tom_roush.pdfbox.pdmodel.interactive.action.PDActionGoTo) PDDocumentNameDestinationDictionary(com.tom_roush.pdfbox.pdmodel.PDDocumentNameDestinationDictionary) PageMode(com.tom_roush.pdfbox.pdmodel.PageMode) COSDictionary(com.tom_roush.pdfbox.cos.COSDictionary) PDDocumentOutline(com.tom_roush.pdfbox.pdmodel.interactive.documentnavigation.outline.PDDocumentOutline) PDAnnotation(com.tom_roush.pdfbox.pdmodel.interactive.annotation.PDAnnotation) PDParentTreeValue(com.tom_roush.pdfbox.pdmodel.documentinterchange.logicalstructure.PDParentTreeValue) PDResources(com.tom_roush.pdfbox.pdmodel.PDResources) IOException(java.io.IOException) PDDestination(com.tom_roush.pdfbox.pdmodel.interactive.documentnavigation.destination.PDDestination) PDStream(com.tom_roush.pdfbox.pdmodel.common.PDStream) PDDocumentCatalog(com.tom_roush.pdfbox.pdmodel.PDDocumentCatalog) PDDocumentNameDictionary(com.tom_roush.pdfbox.pdmodel.PDDocumentNameDictionary) COSInteger(com.tom_roush.pdfbox.cos.COSInteger) PDOutlineItem(com.tom_roush.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem) Map(java.util.Map) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap)

Example 34 with PDResources

use of com.tom_roush.pdfbox.pdmodel.PDResources in project PdfBox-Android by TomRoush.

the class Overlay method createOverlayXObject.

private COSName createOverlayXObject(PDPage page, LayoutPage layoutPage) {
    PDFormXObject xobjForm = new PDFormXObject(layoutPage.overlayContentStream);
    xobjForm.setResources(new PDResources(layoutPage.overlayResources));
    xobjForm.setFormType(1);
    xobjForm.setBBox(layoutPage.overlayMediaBox.createRetranslatedRectangle());
    AffineTransform at = new AffineTransform();
    switch(layoutPage.overlayRotation) {
        case 90:
            at.translate(0, layoutPage.overlayMediaBox.getWidth());
            at.rotate(Math.toRadians(-90));
            break;
        case 180:
            at.translate(layoutPage.overlayMediaBox.getWidth(), layoutPage.overlayMediaBox.getHeight());
            at.rotate(Math.toRadians(-180));
            break;
        case 270:
            at.translate(layoutPage.overlayMediaBox.getHeight(), 0);
            at.rotate(Math.toRadians(-270));
            break;
        default:
            break;
    }
    xobjForm.setMatrix(at);
    PDResources resources = page.getResources();
    return resources.add(xobjForm, "OL");
}
Also used : PDFormXObject(com.tom_roush.pdfbox.pdmodel.graphics.form.PDFormXObject) PDResources(com.tom_roush.pdfbox.pdmodel.PDResources) AffineTransform(com.tom_roush.harmony.awt.geom.AffineTransform)

Example 35 with PDResources

use of com.tom_roush.pdfbox.pdmodel.PDResources in project PdfBox-Android by TomRoush.

the class PDTilingPattern method getResources.

/**
 * This will get the resources for this pattern.
 * This will return null if no resources are available at this level.
 * @return The resources for this pattern.
 */
@Override
public PDResources getResources() {
    PDResources retval = null;
    COSBase base = getCOSObject().getDictionaryObject(COSName.RESOURCES);
    if (base instanceof COSDictionary) {
        retval = new PDResources((COSDictionary) base);
    }
    return retval;
}
Also used : COSDictionary(com.tom_roush.pdfbox.cos.COSDictionary) PDResources(com.tom_roush.pdfbox.pdmodel.PDResources) COSBase(com.tom_roush.pdfbox.cos.COSBase)

Aggregations

PDResources (com.tom_roush.pdfbox.pdmodel.PDResources)44 PDPage (com.tom_roush.pdfbox.pdmodel.PDPage)13 PDRectangle (com.tom_roush.pdfbox.pdmodel.common.PDRectangle)13 PDDocument (com.tom_roush.pdfbox.pdmodel.PDDocument)11 COSName (com.tom_roush.pdfbox.cos.COSName)9 Matrix (com.tom_roush.pdfbox.util.Matrix)9 IOException (java.io.IOException)8 PDFont (com.tom_roush.pdfbox.pdmodel.font.PDFont)7 PDFormXObject (com.tom_roush.pdfbox.pdmodel.graphics.form.PDFormXObject)7 File (java.io.File)7 COSDictionary (com.tom_roush.pdfbox.cos.COSDictionary)6 COSBase (com.tom_roush.pdfbox.cos.COSBase)5 PDPageContentStream (com.tom_roush.pdfbox.pdmodel.PDPageContentStream)5 AffineTransform (com.tom_roush.harmony.awt.geom.AffineTransform)4 PDAppearanceContentStream (com.tom_roush.pdfbox.pdmodel.PDAppearanceContentStream)4 PDColor (com.tom_roush.pdfbox.pdmodel.graphics.color.PDColor)4 PDGraphicsState (com.tom_roush.pdfbox.pdmodel.graphics.state.PDGraphicsState)4 PDAppearanceStream (com.tom_roush.pdfbox.pdmodel.interactive.annotation.PDAppearanceStream)4 PDDocumentCatalog (com.tom_roush.pdfbox.pdmodel.PDDocumentCatalog)3 PDStream (com.tom_roush.pdfbox.pdmodel.common.PDStream)3