Package org.apache.pdfbox.io

Examples of org.apache.pdfbox.io.RandomAccessBuffer


                    pdfDocument = PDDocument.load(new CloseShieldInputStream(stream), scratchFile, true);
                }
            } else {
                // Go for the normal, stream based in-memory parsing
                if (localConfig.getUseNonSequentialParser() == true){
                    pdfDocument = PDDocument.loadNonSeq(new CloseShieldInputStream(stream), new RandomAccessBuffer());
                } else {
                    pdfDocument = PDDocument.load(new CloseShieldInputStream(stream), true);
                }
            }
           
View Full Code Here


        {
            createScratchFile(scratchDirectory);
        }
        if (buffer == null)
        {
            buffer = new RandomAccessBuffer();
        }
    }
View Full Code Here

        {
            createScratchFile(scratchDirectory);
        }
        if (buffer == null)
        {
            buffer = new RandomAccessBuffer();
        }
    }
View Full Code Here

        assertTrue(pdf.length > 200);
        assertEquals("%PDF-1.4", new String(copyOfRange(pdf, 0, 8), "UTF-8"));
        assertEquals("%%EOF\n", new String(copyOfRange(pdf, pdf.length - 6, pdf.length), "UTF-8"));

        // Load
        PDDocument loadDoc = PDDocument.load(new ByteArrayInputStream(pdf), new RandomAccessBuffer());
        assertEquals(1, loadDoc.getNumberOfPages());
        loadDoc.close();
    }
View Full Code Here

        assertTrue(pdf.length > 200);
        assertEquals("%PDF-1.4", new String(copyOfRange(pdf, 0, 8), "UTF-8"));
        assertEquals("%%EOF\n", new String(copyOfRange(pdf, pdf.length - 6, pdf.length), "UTF-8"));

        // Load
        PDDocument loadDoc = PDDocument.load(targetFile, new RandomAccessBuffer());
        assertEquals(1, loadDoc.getNumberOfPages());
        loadDoc.close();
    }
View Full Code Here

        assertTrue(pdf.length > 200);
        assertEquals("%PDF-1.4", new String(copyOfRange(pdf, 0, 8), "UTF-8"));
        assertEquals("%%EOF\n", new String(copyOfRange(pdf, pdf.length - 6, pdf.length), "UTF-8"));

        // Load
        PDDocument loadDoc = PDDocument.loadNonSeq(new ByteArrayInputStream(pdf), new RandomAccessBuffer());
        assertEquals(1, loadDoc.getNumberOfPages());
        loadDoc.close();
    }
View Full Code Here

        assertTrue(pdf.length > 200);
        assertEquals("%PDF-1.4", new String(copyOfRange(pdf, 0, 8), "UTF-8"));
        assertEquals("%%EOF\n", new String(copyOfRange(pdf, pdf.length - 6, pdf.length), "UTF-8"));

        // Load
        PDDocument loadDoc = PDDocument.loadNonSeq(targetFile, new RandomAccessBuffer());
        assertEquals(1, loadDoc.getNumberOfPages());
        loadDoc.close();
    }
View Full Code Here

   
    private COSStream createContentStream(COSBase contents) throws IOException
    {
        List<COSStream> contentStreams = createContentStreamList(contents);
        // concatenate streams
        COSStream concatStream = new COSStream(new RandomAccessBuffer());
        OutputStream out = concatStream.createUnfilteredStream();
        for (COSStream contentStream : contentStreams)
        {
            InputStream in = contentStream.getUnfilteredStream();
            byte[] buf = new byte[2048];
View Full Code Here

                + xObjectId + " Do Q\nQ\n");
    }

    private COSStream createStream(String content) throws IOException
    {
        COSStream stream = new COSStream(new RandomAccessBuffer());
        OutputStream out = stream.createUnfilteredStream();
        out.write(content.getBytes("ISO-8859-1"));
        out.close();
        stream.setFilters(COSName.FLATE_DECODE);
        return stream;
View Full Code Here

                LOG.warn("System property " + SYSPROP_EOFLOOKUPRANGE + " does not contain an integer value, but: '"
                        + eofLookupRangeStr + "'");
            }
        }

        setDocument((raBuf == null) ? new COSDocument(new RandomAccessBuffer(), false) : new COSDocument(raBuf, false));

        pdfSource = new PushBackInputStream(raStream, 4096);

        password = decryptionPassword;
    }
View Full Code Here

TOP

Related Classes of org.apache.pdfbox.io.RandomAccessBuffer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.