stacktome
stacktome

Reputation: 790

how to solve the issue with apache pdfbox-app jar

I'm working with pdfbox-app jar in the current development project.
What I notice was they have removed the PDPageable class after “pdfbox-app-2.0.0-20140226.103319-176.jar release. because of that I'm getting a compilation error in setPageable() method.
I like to know the alternative suggestion for this.

As my know they have removed the PDPageable class after “pdfbox-app-2.0.0-20140226.103319-176.jar this release.

I know is not stable to use the snapshots for the development. But i like to give a release with the latest pdfbox-app jar. Thank you.

Upvotes: 1

Views: 1373

Answers (1)

Tilman Hausherr
Tilman Hausherr

Reputation: 18936

The best is to download the 2.0 sources with svn https://pdfbox.apache.org/downloads.html#scm and look at the examples. The printing has been changed recently to be more flexible. Search for PDFPrinter and its uses, e.g. in PDFReader.java:

                    PDFPrinter printer = new PDFPrinter(document);
                    PrinterJob job = PrinterJob.getPrinterJob();
                    job.setPageable(printer.getPageable());
                    if (job.printDialog())
                    {
                        job.print();
                    }

Note that PDFPrinter has many new cool constructors to allow more flexibility when printing.

Upvotes: 1

Related Questions