Package org.apache.pdfbox.io

Examples of org.apache.pdfbox.io.RandomAccessFile


     * @throws IOException if something went wrong
     */
    public COSDocument(File scratchDir, boolean forceParsingValue) throws IOException
    {
        tmpFile = File.createTempFile("pdfbox-", ".tmp", scratchDir);
        scratchFile = new RandomAccessFile(tmpFile, "rw");
        forceParsing = forceParsingValue;
    }
View Full Code Here


     * @throws IOException if something went wrong
     */
    public COSDocument(File scratchDir, boolean forceParsingValue) throws IOException
    {
        tmpFile = File.createTempFile("pdfbox-", ".tmp", scratchDir);
        scratchFile = new RandomAccessFile(tmpFile, "rw");
        forceParsing = forceParsingValue;
    }
View Full Code Here

     * @param inputFile The input stream that contains the PDF document.
     *
     * @throws IOException If there is an error initializing the stream.
     */
    public ConformingPDFParser(File inputFile) throws IOException {
        this.inputFile = new RandomAccessFile(inputFile, "r");
    }
View Full Code Here

    {
        String tiffG3Path = "src/test/resources/org/apache/pdfbox/pdmodel/graphics/xobject/ccittg3.tif";
        String tiffG4Path = "src/test/resources/org/apache/pdfbox/pdmodel/graphics/xobject/ccittg4.tif";
       
        PDDocument document = new PDDocument();
        RandomAccess reader = new RandomAccessFile(new File(tiffG3Path), "r");
        PDXObjectImage ximage3 = new PDCcitt(document, reader);
        validate(ximage3, 1, 344, 287, "tiff", PDDeviceGray.NAME);
        BufferedImage bim3 = ImageIO.read(new File(tiffG3Path));
        checkIdent(bim3, ximage3.getRGBImage());
        PDPage page = new PDPage(PDPage.PAGE_SIZE_A4);
        document.addPage(page);
        PDPageContentStream contentStream = new PDPageContentStream(document, page, true, false);
        contentStream.drawXObject(ximage3, 0, 0, ximage3.getWidth(), ximage3.getHeight());
        contentStream.close();

        reader = new RandomAccessFile(new File(tiffG4Path), "r");
        PDXObjectImage ximage4 = new PDCcitt(document, reader);
        validate(ximage4, 1, 344, 287, "tiff", PDDeviceGray.NAME);
        BufferedImage bim4 = ImageIO.read(new File(tiffG3Path));
        checkIdent(bim4, ximage4.getRGBImage());
        page = new PDPage(PDPage.PAGE_SIZE_A4);
View Full Code Here

        imageReader.setInput(is);
        int countTiffImages = imageReader.getNumImages(true);
        assertTrue(countTiffImages > 1);
       
        PDDocument document = new PDDocument();
        RandomAccess reader = new RandomAccessFile(new File(tiffPath), "r");
       
        int pdfPageNum = 0;
        while (true)
        {
            PDXObjectImage ximage = null;
View Full Code Here

     * @throws IOException if something went wrong
     */
    public COSDocument(File scratchDir, boolean forceParsingValue) throws IOException
    {
        tmpFile = File.createTempFile("pdfbox-", ".tmp", scratchDir);
        scratchFile = new RandomAccessFile(tmpFile, "rw");
        forceParsing = forceParsingValue;
    }
View Full Code Here

     * @throws IOException if something went wrong
     */
    public COSDocument(File scratchDir, boolean forceParsingValue) throws IOException
    {
        tmpFile = File.createTempFile("pdfbox-", ".tmp", scratchDir);
        scratchFile = new RandomAccessFile(tmpFile, "rw");
        forceParsing = forceParsingValue;
    }
View Full Code Here

     *                     document content where possible
     */
    public COSDocument(File scratchDir, boolean forceParsing)
            throws IOException {
        this.tmpFile = File.createTempFile("pdfbox-", ".tmp", scratchDir);
        this.scratchFile = new RandomAccessFile(tmpFile, "rw");
        this.forceParsing = forceParsing;
    }
View Full Code Here

            {
                ximage = new PDJpeg(doc, new FileInputStream( image ) );
            }
            else if (image.toLowerCase().endsWith(".tif") || image.toLowerCase().endsWith(".tiff"))
            {
                ximage = new PDCcitt(doc, new RandomAccessFile(new File(image),"r"));
            }
            else
            {
                //BufferedImage awtImage = ImageIO.read( new File( image ) );
                //ximage = new PDPixelMap(doc, awtImage);
View Full Code Here

            {
                ximage = new PDJpeg(doc, new FileInputStream( image ) );
            }
            else if (image.toLowerCase().endsWith(".tif") || image.toLowerCase().endsWith(".tiff"))
            {
                ximage = new PDCcitt(doc, new RandomAccessFile(new File(image),"r"));
            }
            else
            {
                //BufferedImage awtImage = ImageIO.read( new File( image ) );
                //ximage = new PDPixelMap(doc, awtImage);
View Full Code Here

TOP

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

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.