You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by Robert Strauch <ro...@gmx.de> on 2014/06/04 23:58:33 UTC

Cannot find convertToImage() in self-built pdfbox-jar

Hello,

This is the first time I'm building PDFBox from source code.

I have downloaded the latest source code of PDFBox from the trunk and
have built it using "mvn clean install" as stated on the website. The
build process finished without errors.

However I'm puzzled... with the pre-built binary version 1.8.5 the
method convertToImage() could be called on a PDPage object. When adding
the just built 2.0.0-SNAPSHOT to the build path of my application, I
cannot invoke this method anymore. Eclipse's code-completion does not
list it.

Am I missing something?

Sincerely,
Robert


Re: Cannot find convertToImage() in self-built pdfbox-jar

Posted by Robert Strauch <ro...@gmx.de>.
This works fine.

Thanks a lot :-)
Robert

Am 05.06.2014 00:02 schrieb Tilman Hausherr:
> API has changed... here's a code example:
> 
>             PDDocument document = PDDocument.loadNonSeq(file, null);
>             String outputPrefix = outDir + file.getName() + "-";
>             int numPages = document.getNumberOfPages();
>             PDFRenderer renderer = new PDFRenderer(document);
>             for (int i = 0; i < numPages; i++)
>             {
>                 String fileName = outputPrefix + (i + 1) + ".png";
>                 BufferedImage image = renderer.renderImageWithDPI(i,
> 96); // Windows native DPI
>                 ImageIOUtil.writeImage(image, fileName, 96);
>             }
> 
> 
> Am 04.06.2014 23:58, schrieb Robert Strauch:
>> Hello,
>> 
>> This is the first time I'm building PDFBox from source code.
>> 
>> I have downloaded the latest source code of PDFBox from the trunk and
>> have built it using "mvn clean install" as stated on the website. The
>> build process finished without errors.
>> 
>> However I'm puzzled... with the pre-built binary version 1.8.5 the
>> method convertToImage() could be called on a PDPage object. When 
>> adding
>> the just built 2.0.0-SNAPSHOT to the build path of my application, I
>> cannot invoke this method anymore. Eclipse's code-completion does not
>> list it.
>> 
>> Am I missing something?
>> 
>> Sincerely,
>> Robert
>> 

Re: Cannot find convertToImage() in self-built pdfbox-jar

Posted by Tilman Hausherr <TH...@t-online.de>.
API has changed... here's a code example:

             PDDocument document = PDDocument.loadNonSeq(file, null);
             String outputPrefix = outDir + file.getName() + "-";
             int numPages = document.getNumberOfPages();
             PDFRenderer renderer = new PDFRenderer(document);
             for (int i = 0; i < numPages; i++)
             {
                 String fileName = outputPrefix + (i + 1) + ".png";
                 BufferedImage image = renderer.renderImageWithDPI(i, 
96); // Windows native DPI
                 ImageIOUtil.writeImage(image, fileName, 96);
             }


Am 04.06.2014 23:58, schrieb Robert Strauch:
> Hello,
>
> This is the first time I'm building PDFBox from source code.
>
> I have downloaded the latest source code of PDFBox from the trunk and
> have built it using "mvn clean install" as stated on the website. The
> build process finished without errors.
>
> However I'm puzzled... with the pre-built binary version 1.8.5 the
> method convertToImage() could be called on a PDPage object. When adding
> the just built 2.0.0-SNAPSHOT to the build path of my application, I
> cannot invoke this method anymore. Eclipse's code-completion does not
> list it.
>
> Am I missing something?
>
> Sincerely,
> Robert
>