Re: How do I analyze a problem PDF?
No, the document has not been closed prematurely. It's being processed through the same calls that I use for all my other documents that must merge a PDF, either ones I create or ones from a repository. In this code ... File outpath = new File(OUT_DIR, "mergedTwoPdfs.pdf"); document.save(new FileOutputStream(outpath.toString())); ... when I trace the execution in Eclipse, document's close member is false immediately before calling document.save(). Something else interesting: When I use PDFMerge to merge the good, 40K PDF with another document, the output PDF is only 2K larger than the two files themselves. But when I merge the original 39K PDF, the output is almost 40K larger than the two files. The code below will cause the error. The two portions in curly brackets are (essentially) the merge method in my PrintToPdf class. The stack trace is the same. The odd PDF is the second one, "moroccan_chicken.pdf". I can see about a place to post it tomorrow, through a short-term anonymous FTP at my office. In the meanwhile I'll see if anything from PDFDebugger makes sense to me. :) @Test public void testMerge2PdfDocs() throws Exception { File file0 = new File(this.getClass().getResource("/Bacon and Brussels Sprout Hash.pdf").toURI()); byte [] buf0 = IOUtils.toByteArray(new FileInputStream(file0)); File file1 = new File(this.getClass().getResource("/moroccan_chicken.pdf").toURI()); byte [] buf1 = IOUtils.toByteArray(new FileInputStream(file1)); PDDocument document = new PDDocument(); { PDFMergerUtility merger = new PDFMergerUtility(); PDDocument inDoc = PDDocument.load(buf0); merger.appendDocument(document, inDoc); inDoc.close(); } { PDFMergerUtility merger = new PDFMergerUtility(); PDDocument inDoc = PDDocument.load(buf1); merger.appendDocument(document, inDoc); inDoc.close(); } File outpath = new File(OUT_DIR, "mergedTwoPdfs.pdf"); document.save(new FileOutputStream(outpath.toString())); document.close(); assert true; } On Tue, Feb 28, 2017 at 5:30 PM, Tilman Hausherrwrote: > The best would be to upload the PDF somewhere, and also post your code. > > I analyse PDFs sometimes with NOTEPAD++, sometimes with PDFDebugger, and > often both. But these help only those who know what to expect. > > The text below looks like a COSStream was closed prematurely (did you > close the source documents too early?). I'd rather suspect a bug in your > code or in our code. > > Tilman > > > > > Am 28.02.2017 um 23:16 schrieb Thad Humphries: > >> I have a PDF 1.4 document that opens in different PDF viewers without >> warnings, yet there seems to be something odd about it. How might I >> analyze >> it? >> >> If I merge this PDF from the command line with pdfbox-app-2.0.4.jar's >> PDFMerger, the output is fine. However anytime I merge it in my own code, >> where it is first opened into a byte array, loaded to a document, then >> call >> PDFMergerUtility's appendDocument(destination, source), the >> destination PDDocument cannot be saved to disk. This is the only PDF of >> several dozen I've tested with this problem. I see nothing odd when I >> trace >> the program in a debugger. It fails only at PDDocument save() (stack trace >> below). >> >> If I open the original PDF (39K) in MacOSX Yosemite's Preview and save it, >> the saved PDF is now 40K, and it merges just fine in my code. (I believe >> this PDF was created about 5 years ago, most likely with the export-to-PDF >> action using OpenOffice on Linux. ) >> >> I expect that I'll see odd PDFs like this from time to time. (Lord knows >> that I've amassed quite a collection of buggy TIFF images over the years.) >> With TIFFs I can find out a lot using libtiff's tiffinfo and tiffdump >> utilities and a hex editor. Are there any routines in PDFBox that might >> help me with PDF files? Are there any other tools, open source or >> commercial? >> >> >> Stack trace from JUnit: >> >> java.io.IOException: COSStream has been closed and cannot be read. Perhaps >> its enclosing PDDocument has been closed? >> at org.apache.pdfbox.cos.COSStream.checkClosed(COSStream.java:77) >> at org.apache.pdfbox.cos.COSStream.createRawInputStream(COSStre >> am.java:125) >> at >> org.apache.pdfbox.pdfwriter.COSWriter.visitFromStream(COSWri >> ter.java:1200) >> at org.apache.pdfbox.cos.COSStream.accept(COSStream.java:383) >> at org.apache.pdfbox.cos.COSObject.accept(COSObject.java:158) >> at org.apache.pdfbox.pdfwriter.COSWriter.doWriteObject(COSWrite >> r.java:522) >> at org.apache.pdfbox.pdfwriter.COSWriter.doWriteObjects(COSWrit >> er.java:460) >> at org.apache.pdfbox.pdfwriter.COSWriter.doWriteBody(COSWriter.java:444) >> at >> org.apache.pdfbox.pdfwriter.COSWriter.visitFromDocument(COSW >> riter.java:1096) >> at org.apache.pdfbox.cos.COSDocument.accept(COSDocument.java:419) >> at org.apache.pdfbox.pdfwriter.COSWriter.write(COSWriter.java:1367) >> at
Re: How do I analyze a problem PDF?
The best would be to upload the PDF somewhere, and also post your code. I analyse PDFs sometimes with NOTEPAD++, sometimes with PDFDebugger, and often both. But these help only those who know what to expect. The text below looks like a COSStream was closed prematurely (did you close the source documents too early?). I'd rather suspect a bug in your code or in our code. Tilman Am 28.02.2017 um 23:16 schrieb Thad Humphries: I have a PDF 1.4 document that opens in different PDF viewers without warnings, yet there seems to be something odd about it. How might I analyze it? If I merge this PDF from the command line with pdfbox-app-2.0.4.jar's PDFMerger, the output is fine. However anytime I merge it in my own code, where it is first opened into a byte array, loaded to a document, then call PDFMergerUtility's appendDocument(destination, source), the destination PDDocument cannot be saved to disk. This is the only PDF of several dozen I've tested with this problem. I see nothing odd when I trace the program in a debugger. It fails only at PDDocument save() (stack trace below). If I open the original PDF (39K) in MacOSX Yosemite's Preview and save it, the saved PDF is now 40K, and it merges just fine in my code. (I believe this PDF was created about 5 years ago, most likely with the export-to-PDF action using OpenOffice on Linux. ) I expect that I'll see odd PDFs like this from time to time. (Lord knows that I've amassed quite a collection of buggy TIFF images over the years.) With TIFFs I can find out a lot using libtiff's tiffinfo and tiffdump utilities and a hex editor. Are there any routines in PDFBox that might help me with PDF files? Are there any other tools, open source or commercial? Stack trace from JUnit: java.io.IOException: COSStream has been closed and cannot be read. Perhaps its enclosing PDDocument has been closed? at org.apache.pdfbox.cos.COSStream.checkClosed(COSStream.java:77) at org.apache.pdfbox.cos.COSStream.createRawInputStream(COSStream.java:125) at org.apache.pdfbox.pdfwriter.COSWriter.visitFromStream(COSWriter.java:1200) at org.apache.pdfbox.cos.COSStream.accept(COSStream.java:383) at org.apache.pdfbox.cos.COSObject.accept(COSObject.java:158) at org.apache.pdfbox.pdfwriter.COSWriter.doWriteObject(COSWriter.java:522) at org.apache.pdfbox.pdfwriter.COSWriter.doWriteObjects(COSWriter.java:460) at org.apache.pdfbox.pdfwriter.COSWriter.doWriteBody(COSWriter.java:444) at org.apache.pdfbox.pdfwriter.COSWriter.visitFromDocument(COSWriter.java:1096) at org.apache.pdfbox.cos.COSDocument.accept(COSDocument.java:419) at org.apache.pdfbox.pdfwriter.COSWriter.write(COSWriter.java:1367) at org.apache.pdfbox.pdfwriter.COSWriter.write(COSWriter.java:1254) at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:1232) at com.jthad.util.image.TestPrintToPdf.testMergeTwoPdfDocs(TestPrintToPdf.java:192) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
How do I analyze a problem PDF?
I have a PDF 1.4 document that opens in different PDF viewers without warnings, yet there seems to be something odd about it. How might I analyze it? If I merge this PDF from the command line with pdfbox-app-2.0.4.jar's PDFMerger, the output is fine. However anytime I merge it in my own code, where it is first opened into a byte array, loaded to a document, then call PDFMergerUtility's appendDocument(destination, source), the destination PDDocument cannot be saved to disk. This is the only PDF of several dozen I've tested with this problem. I see nothing odd when I trace the program in a debugger. It fails only at PDDocument save() (stack trace below). If I open the original PDF (39K) in MacOSX Yosemite's Preview and save it, the saved PDF is now 40K, and it merges just fine in my code. (I believe this PDF was created about 5 years ago, most likely with the export-to-PDF action using OpenOffice on Linux. ) I expect that I'll see odd PDFs like this from time to time. (Lord knows that I've amassed quite a collection of buggy TIFF images over the years.) With TIFFs I can find out a lot using libtiff's tiffinfo and tiffdump utilities and a hex editor. Are there any routines in PDFBox that might help me with PDF files? Are there any other tools, open source or commercial? Stack trace from JUnit: java.io.IOException: COSStream has been closed and cannot be read. Perhaps its enclosing PDDocument has been closed? at org.apache.pdfbox.cos.COSStream.checkClosed(COSStream.java:77) at org.apache.pdfbox.cos.COSStream.createRawInputStream(COSStream.java:125) at org.apache.pdfbox.pdfwriter.COSWriter.visitFromStream(COSWriter.java:1200) at org.apache.pdfbox.cos.COSStream.accept(COSStream.java:383) at org.apache.pdfbox.cos.COSObject.accept(COSObject.java:158) at org.apache.pdfbox.pdfwriter.COSWriter.doWriteObject(COSWriter.java:522) at org.apache.pdfbox.pdfwriter.COSWriter.doWriteObjects(COSWriter.java:460) at org.apache.pdfbox.pdfwriter.COSWriter.doWriteBody(COSWriter.java:444) at org.apache.pdfbox.pdfwriter.COSWriter.visitFromDocument(COSWriter.java:1096) at org.apache.pdfbox.cos.COSDocument.accept(COSDocument.java:419) at org.apache.pdfbox.pdfwriter.COSWriter.write(COSWriter.java:1367) at org.apache.pdfbox.pdfwriter.COSWriter.write(COSWriter.java:1254) at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:1232) at com.jthad.util.image.TestPrintToPdf.testMergeTwoPdfDocs(TestPrintToPdf.java:192) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) -- "Hell hath no limits, nor is circumscrib'd In one self-place; but where we are is hell, And where hell is, there must we ever be" --Christopher Marlowe, *Doctor Faustus* (v. 121-24)
Re: apache licensing problem
Am 28.02.2017 um 20:57 schrieb ger...@hispeed.ch: Thanks for your answers. Sorry for not being so clear in my message. This line: * provide clear attribution to The Apache Software Foundation for any distributions that include Apache software. my main reason is that I am not sure how to "provide clear attribution". I have put a copy of the license in the top of my directory and a NOTICE saying that the program includes software developed at the Apache Software Foundation. I am not sure what else to do? Sounds ok to me. You can also ask here: https://issues.apache.org/jira/browse/LEGAL Tilman Best Regards Gerry On 28.02.2017 19:55, Tilman Hausherr wrote: Am 28.02.2017 um 19:32 schrieb Tres Finocchiaro: Here's a section from apache.org specifically labeled "I'M NOT A LAWYER. WHAT DOES IT ALL MEAN?" - http://www.apache.org/foundation/license-faq.html#WhatDoesItMEAN This is a good place to start, because it's from a "Frequently Asked Questions" which is specifically aimed at the high-level questions. Note, this FAQ is written surrounding the 1.0, 1.1 and 2.0 versions, so if there is a portion you have questions about, you should read the exact text from the 2.0 license. That's a nice link. There is no reason to panic. The apache license is a very friendly license. You don't pay anything, and you're not required to publish your sources, but you must attribute the work you are using - which any nice person would do anyway. Tilman -Tres - tres.finocchi...@gmail.com On Tue, Feb 28, 2017 at 1:10 PM, Tilman Hausherrwrote: Am 28.02.2017 um 10:43 schrieb ger...@hispeed.ch: Hi I have written a program that uses pdfbox. What do I have to do with it so that I legally conform to the apache 2.0 license. Sorry to bother you with such a naive question its just that legal stuff always makes me panic. Read it here: https://www.apache.org/licenses/LICENSE-2.0 https://en.wikipedia.org/wiki/Apache_License IMHO it is pretty clear what you have to do. However if reading that makes you panic, you'll have to hire an attorney :-( Tilman - To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org - To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org - To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org
Re: apache licensing problem
Thanks for your answers. Sorry for not being so clear in my message. This line: * provide clear attribution to The Apache Software Foundation for any distributions that include Apache software. my main reason is that I am not sure how to "provide clear attribution". I have put a copy of the license in the top of my directory and a NOTICE saying that the program includes software developed at the Apache Software Foundation. I am not sure what else to do? Best Regards Gerry On 28.02.2017 19:55, Tilman Hausherr wrote: Am 28.02.2017 um 19:32 schrieb Tres Finocchiaro: Here's a section from apache.org specifically labeled "I'M NOT A LAWYER. WHAT DOES IT ALL MEAN?" - http://www.apache.org/foundation/license-faq.html#WhatDoesItMEAN This is a good place to start, because it's from a "Frequently Asked Questions" which is specifically aimed at the high-level questions. Note, this FAQ is written surrounding the 1.0, 1.1 and 2.0 versions, so if there is a portion you have questions about, you should read the exact text from the 2.0 license. That's a nice link. There is no reason to panic. The apache license is a very friendly license. You don't pay anything, and you're not required to publish your sources, but you must attribute the work you are using - which any nice person would do anyway. Tilman -Tres - tres.finocchi...@gmail.com On Tue, Feb 28, 2017 at 1:10 PM, Tilman Hausherrwrote: Am 28.02.2017 um 10:43 schrieb ger...@hispeed.ch: Hi I have written a program that uses pdfbox. What do I have to do with it so that I legally conform to the apache 2.0 license. Sorry to bother you with such a naive question its just that legal stuff always makes me panic. Read it here: https://www.apache.org/licenses/LICENSE-2.0 https://en.wikipedia.org/wiki/Apache_License IMHO it is pretty clear what you have to do. However if reading that makes you panic, you'll have to hire an attorney :-( Tilman - To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org - To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org
Re: How to certify a PDF
Am 19.10.2016 um 14:44 schrieb Damien Butaye: Diego, https://www.wetransfer.com/downloads/b53c2e61914a1d02d63ff0b631b75e5520161019123905/77df7c04ee02aa478962d2ef2d33f8f120161019123905/160cb1 The sign_me.pdf is the orginal file and the out.pdf is the certified pdf. As my certificate is a self signed certificate, I had to trust it before to get a trusted certification. Could you re-upload this? I used the various codes posted here and it looked... easy. It worked... I didn't use the seed stuff. Tilman - To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org
Re: (JAI) Image I/O Tools are not installed
Hi, I verified the pom and it ended up being a silly thing: test After I remove this from all jai dependencies I get what it is supposed... [JPG, JPEG 2000, tiff, bmp, PCX, gif, WBMP, PNG, RAW, JPEG, PNM, tif, TIFF, jpeg, wbmp, jbig2, jpg, JPEG2000, BMP, pcx, GIF, png, raw, JBIG2, pnm, TIF, jpeg2000, jpeg 2000] It was my fault. I just copied the dependencies from https://svn.apache.org/viewvc/pdfbox/trunk/parent/pom.xml?view=markup and forgot to remove the scope. I am sorry. Thank you all for your help. Best regards. Jorge Flórez 2017-02-28 13:45 GMT-05:00 Tilman Hausherr: > Am 28.02.2017 um 19:23 schrieb jorgeeflorez .: > >> Hi Tilman, >> >> this is what I get: >> >> [JPG, jpg, bmp, BMP, gif, GIF, WBMP, png, PNG, wbmp, jpeg, JPEG] >> > > Then it's really not there... JBIG2 is also missing. I'd suspect some > problem with your build... try > - do a clean build > - verify that your pom is ok re: syntax > - run the tool both in and outside of your IDE > - have a look what is in your manifest / in your class path, i.e. what is > really there? Look in the directories. You can look at jar files with any > zip tool, e.g. 7zip. > - post the fill pom file. > > Tilman > > > > >> >> 2017-02-28 13:04 GMT-05:00 Tilman Hausherr : >> >> Am 28.02.2017 um 18:56 schrieb jorgeeflorez .: >>> >>> Hi Maruan, thank you for your reply. Yes, I already had a look at that page, from that I took the dependencies I put in the pom I showed in my mail. I am getting the error even when the suggested dependencies are set. It's very weird, I use the same dependencies and it works. >>> >>> Please include >>> >>> |System.out.println(Arrays.toString(ImageIO.getReaderFormatNames()));| >>> >>> in your code at the start, what do you get? >>> >>> Tilman >>> >>> >>> >>> >>> Regards. Jorge Flórez 2017-02-28 11:43 GMT-05:00 Maruan Sahyoun : Hi, > please take a lookt at https://pdfbox.apache.org/2.0/dependencies.html > under Optional Components/JAI Image I/O > > Hope that helps. > > Best regards > > Maruan > > > Am 28.02.2017 um 17:19 schrieb jorgeeflorez . < > jorgeeduardoflo...@gmail.com>: > > Hi all, >> >> I am getting some errors with version 2.0.4. In a small maven project >> I >> >> set > > up, when I try to render a page from a PDF file, I get this in console: >> >> ERROR [main] (PDFStreamEngine.java:866) - Cannot read JPEG2000 image: >> >> Java > > Advanced Imaging (JAI) Image I/O Tools are not installed >> >> This is the pom for the project: >> >> UTF-8> >> sourceEncoding> > > 1.8 >> 1.8 >> >> >> >> org.apache.pdfbox >> pdfbox >> 2.0.4 >> >> >> org.apache.pdfbox >> pdfbox-tools >> 2.0.4 >> >> >> junit >> junit >> 4.12 >> test >> >> >> commons-logging >> commons-logging >> 1.2 >> >> >> commons-io >> commons-io >> 2.4 >> test >> >> >> org.bouncycastle >> bcprov-jdk15on >> 1.55 >> >> >> org.bouncycastle >> bcmail-jdk15on >> 1.55 >> >> >> org.bouncycastle >> bcpkix-jdk15on >> 1.55 >> >> >> log4j >> log4j >> 1.2.17 >> >> >> >> com.levigo.jbig2 >> levigo-jbig2-imageio >> 1.6.5 >> test >> >> >> com.github.jai-imageio >> jai-imageio-core >> 1.3.1 >> test >> >> >> com.github.jai-imageio >> jai-imageio-jpeg2000 >> 1.3.0 >> test >> >> >> >> I added the dependencies you suggest (I think) in >> https://pdfbox.apache.org/2.0/dependencies.html. >> >> After some debugging I came up with this stack trace: >> >> org.apache.pdfbox.filter.MissingImageReaderException: Cannot read >> >> JPEG2000 > > image: Java Advanced Imaging (JAI) Image I/O Tools are not installed >> at org.apache.pdfbox.filter.Filter.findImageReader(Filter.java:
Re: apache licensing problem
Am 28.02.2017 um 19:32 schrieb Tres Finocchiaro: Here's a section from apache.org specifically labeled "I'M NOT A LAWYER. WHAT DOES IT ALL MEAN?" - http://www.apache.org/foundation/license-faq.html#WhatDoesItMEAN This is a good place to start, because it's from a "Frequently Asked Questions" which is specifically aimed at the high-level questions. Note, this FAQ is written surrounding the 1.0, 1.1 and 2.0 versions, so if there is a portion you have questions about, you should read the exact text from the 2.0 license. That's a nice link. There is no reason to panic. The apache license is a very friendly license. You don't pay anything, and you're not required to publish your sources, but you must attribute the work you are using - which any nice person would do anyway. Tilman -Tres - tres.finocchi...@gmail.com On Tue, Feb 28, 2017 at 1:10 PM, Tilman Hausherrwrote: Am 28.02.2017 um 10:43 schrieb ger...@hispeed.ch: Hi I have written a program that uses pdfbox. What do I have to do with it so that I legally conform to the apache 2.0 license. Sorry to bother you with such a naive question its just that legal stuff always makes me panic. Read it here: https://www.apache.org/licenses/LICENSE-2.0 https://en.wikipedia.org/wiki/Apache_License IMHO it is pretty clear what you have to do. However if reading that makes you panic, you'll have to hire an attorney :-( Tilman - To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org - To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org
Re: (JAI) Image I/O Tools are not installed
Am 28.02.2017 um 19:23 schrieb jorgeeflorez .: Hi Tilman, this is what I get: [JPG, jpg, bmp, BMP, gif, GIF, WBMP, png, PNG, wbmp, jpeg, JPEG] Then it's really not there... JBIG2 is also missing. I'd suspect some problem with your build... try - do a clean build - verify that your pom is ok re: syntax - run the tool both in and outside of your IDE - have a look what is in your manifest / in your class path, i.e. what is really there? Look in the directories. You can look at jar files with any zip tool, e.g. 7zip. - post the fill pom file. Tilman 2017-02-28 13:04 GMT-05:00 Tilman Hausherr: Am 28.02.2017 um 18:56 schrieb jorgeeflorez .: Hi Maruan, thank you for your reply. Yes, I already had a look at that page, from that I took the dependencies I put in the pom I showed in my mail. I am getting the error even when the suggested dependencies are set. It's very weird, I use the same dependencies and it works. Please include |System.out.println(Arrays.toString(ImageIO.getReaderFormatNames()));| in your code at the start, what do you get? Tilman Regards. Jorge Flórez 2017-02-28 11:43 GMT-05:00 Maruan Sahyoun : Hi, please take a lookt at https://pdfbox.apache.org/2.0/dependencies.html under Optional Components/JAI Image I/O Hope that helps. Best regards Maruan Am 28.02.2017 um 17:19 schrieb jorgeeflorez . < jorgeeduardoflo...@gmail.com>: Hi all, I am getting some errors with version 2.0.4. In a small maven project I set up, when I try to render a page from a PDF file, I get this in console: ERROR [main] (PDFStreamEngine.java:866) - Cannot read JPEG2000 image: Java Advanced Imaging (JAI) Image I/O Tools are not installed This is the pom for the project: UTF-8 sourceEncoding> 1.8 1.8 org.apache.pdfbox pdfbox 2.0.4 org.apache.pdfbox pdfbox-tools 2.0.4 junit junit 4.12 test commons-logging commons-logging 1.2 commons-io commons-io 2.4 test org.bouncycastle bcprov-jdk15on 1.55 org.bouncycastle bcmail-jdk15on 1.55 org.bouncycastle bcpkix-jdk15on 1.55 log4j log4j 1.2.17 com.levigo.jbig2 levigo-jbig2-imageio 1.6.5 test com.github.jai-imageio jai-imageio-core 1.3.1 test com.github.jai-imageio jai-imageio-jpeg2000 1.3.0 test I added the dependencies you suggest (I think) in https://pdfbox.apache.org/2.0/dependencies.html. After some debugging I came up with this stack trace: org.apache.pdfbox.filter.MissingImageReaderException: Cannot read JPEG2000 image: Java Advanced Imaging (JAI) Image I/O Tools are not installed at org.apache.pdfbox.filter.Filter.findImageReader(Filter.java:128) at org.apache.pdfbox.filter.JPXFilter.readJPX(JPXFilter.java:87) at org.apache.pdfbox.filter.JPXFilter.decode(JPXFilter.java:57) at org.apache.pdfbox.cos.COSInputStream.create( COSInputStream.java:69) at org.apache.pdfbox.cos.COSStream.createInputStream( COSStream.java:162) at org.apache.pdfbox.pdmodel.common.PDStream.createInputStream(PDStream. java:235) at org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject. (PDImageXObject.java:160) at org.apache.pdfbox.pdmodel.graphics.PDXObject. createXObject(PDXObject.java:70) at org.apache.pdfbox.pdmodel.PDResources.getXObject(PDResources.java:409) at org.apache.pdfbox.contentstream.operator.graphics.DrawObject.process( DrawObject.java:53) at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator( PDFStreamEngine.java:829) at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators( PDFStreamEngine.java:486) at org.apache.pdfbox.contentstream.PDFStreamEngine. processStream(PDFStreamEngine.java:460) at org.apache.pdfbox.contentstream.PDFStreamEngine. processPage(PDFStreamEngine.java:150) at org.apache.pdfbox.rendering.PageDrawer.drawPage( PageDrawer.java:189) at org.apache.pdfbox.rendering.PDFRenderer.renderImage( PDFRenderer.java:145) at org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI( PDFRenderer.java:94) It is trying to get a reader for "JPEG2000" and can't find it. Am I missing something to make it
Re: apache licensing problem
Here's a section from apache.org specifically labeled "I'M NOT A LAWYER. WHAT DOES IT ALL MEAN?" - http://www.apache.org/foundation/license-faq.html#WhatDoesItMEAN This is a good place to start, because it's from a "Frequently Asked Questions" which is specifically aimed at the high-level questions. Note, this FAQ is written surrounding the 1.0, 1.1 and 2.0 versions, so if there is a portion you have questions about, you should read the exact text from the 2.0 license. -Tres - tres.finocchi...@gmail.com On Tue, Feb 28, 2017 at 1:10 PM, Tilman Hausherrwrote: > Am 28.02.2017 um 10:43 schrieb ger...@hispeed.ch: > >> Hi >> >> I have written a program that uses pdfbox. >> >> What do I have to do with it so that I legally conform to the apache 2.0 >> license. >> >> Sorry to bother you with such a naive question its just that legal stuff >> always makes me panic. >> > > Read it here: > https://www.apache.org/licenses/LICENSE-2.0 > https://en.wikipedia.org/wiki/Apache_License > IMHO it is pretty clear what you have to do. However if reading that makes > you panic, you'll have to hire an attorney :-( > > Tilman > > > > - > To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org > For additional commands, e-mail: users-h...@pdfbox.apache.org > >
Re: (JAI) Image I/O Tools are not installed
Hi Tilman, this is what I get: [JPG, jpg, bmp, BMP, gif, GIF, WBMP, png, PNG, wbmp, jpeg, JPEG] 2017-02-28 13:04 GMT-05:00 Tilman Hausherr: > Am 28.02.2017 um 18:56 schrieb jorgeeflorez .: > >> Hi Maruan, >> >> thank you for your reply. Yes, I already had a look at that page, from >> that >> I took the dependencies I put in the pom I showed in my mail. >> >> I am getting the error even when the suggested dependencies are set. >> > > It's very weird, I use the same dependencies and it works. > > Please include > > |System.out.println(Arrays.toString(ImageIO.getReaderFormatNames()));| > > in your code at the start, what do you get? > > Tilman > > > > >> Regards. >> >> Jorge Flórez >> >> 2017-02-28 11:43 GMT-05:00 Maruan Sahyoun : >> >> Hi, >>> >>> please take a lookt at https://pdfbox.apache.org/2.0/dependencies.html >>> under Optional Components/JAI Image I/O >>> >>> Hope that helps. >>> >>> Best regards >>> >>> Maruan >>> >>> >>> Am 28.02.2017 um 17:19 schrieb jorgeeflorez . < >>> jorgeeduardoflo...@gmail.com>: >>> Hi all, I am getting some errors with version 2.0.4. In a small maven project I >>> set >>> up, when I try to render a page from a PDF file, I get this in console: ERROR [main] (PDFStreamEngine.java:866) - Cannot read JPEG2000 image: >>> Java >>> Advanced Imaging (JAI) Image I/O Tools are not installed This is the pom for the project: UTF-8>>> >>> sourceEncoding> >>> 1.8 1.8 org.apache.pdfbox pdfbox 2.0.4 org.apache.pdfbox pdfbox-tools 2.0.4 junit junit 4.12 test commons-logging commons-logging 1.2 commons-io commons-io 2.4 test org.bouncycastle bcprov-jdk15on 1.55 org.bouncycastle bcmail-jdk15on 1.55 org.bouncycastle bcpkix-jdk15on 1.55 log4j log4j 1.2.17 com.levigo.jbig2 levigo-jbig2-imageio 1.6.5 test com.github.jai-imageio jai-imageio-core 1.3.1 test com.github.jai-imageio jai-imageio-jpeg2000 1.3.0 test I added the dependencies you suggest (I think) in https://pdfbox.apache.org/2.0/dependencies.html. After some debugging I came up with this stack trace: org.apache.pdfbox.filter.MissingImageReaderException: Cannot read >>> JPEG2000 >>> image: Java Advanced Imaging (JAI) Image I/O Tools are not installed at org.apache.pdfbox.filter.Filter.findImageReader(Filter.java:128) at org.apache.pdfbox.filter.JPXFilter.readJPX(JPXFilter.java:87) at org.apache.pdfbox.filter.JPXFilter.decode(JPXFilter.java:57) at org.apache.pdfbox.cos.COSInputStream.create( >>> COSInputStream.java:69) >>> at org.apache.pdfbox.cos.COSStream.createInputStream( >>> COSStream.java:162) >>> at org.apache.pdfbox.pdmodel.common.PDStream.createInputStream(PDStream. >>> java:235) >>> at org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject. >>> (PDImageXObject.java:160) >>> at org.apache.pdfbox.pdmodel.graphics.PDXObject. >>> createXObject(PDXObject.java:70) >>> at org.apache.pdfbox.pdmodel.PDResources.getXObject(PDResources.java:409) at org.apache.pdfbox.contentstream.operator.graphics.DrawObject.process( >>> DrawObject.java:53) >>> at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator( >>> PDFStreamEngine.java:829) >>> at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators( >>> PDFStreamEngine.java:486) >>> at org.apache.pdfbox.contentstream.PDFStreamEngine. >>> processStream(PDFStreamEngine.java:460) >>> at org.apache.pdfbox.contentstream.PDFStreamEngine. >>> processPage(PDFStreamEngine.java:150) >>> at org.apache.pdfbox.rendering.PageDrawer.drawPage( >>> PageDrawer.java:189) >>> at
Re: (JAI) Image I/O Tools are not installed
Am 28.02.2017 um 18:56 schrieb jorgeeflorez .: Hi Maruan, thank you for your reply. Yes, I already had a look at that page, from that I took the dependencies I put in the pom I showed in my mail. I am getting the error even when the suggested dependencies are set. It's very weird, I use the same dependencies and it works. Please include |System.out.println(Arrays.toString(ImageIO.getReaderFormatNames()));| in your code at the start, what do you get? Tilman Regards. Jorge Flórez 2017-02-28 11:43 GMT-05:00 Maruan Sahyoun: Hi, please take a lookt at https://pdfbox.apache.org/2.0/dependencies.html under Optional Components/JAI Image I/O Hope that helps. Best regards Maruan Am 28.02.2017 um 17:19 schrieb jorgeeflorez . < jorgeeduardoflo...@gmail.com>: Hi all, I am getting some errors with version 2.0.4. In a small maven project I set up, when I try to render a page from a PDF file, I get this in console: ERROR [main] (PDFStreamEngine.java:866) - Cannot read JPEG2000 image: Java Advanced Imaging (JAI) Image I/O Tools are not installed This is the pom for the project: UTF-8 sourceEncoding> 1.8 1.8 org.apache.pdfbox pdfbox 2.0.4 org.apache.pdfbox pdfbox-tools 2.0.4 junit junit 4.12 test commons-logging commons-logging 1.2 commons-io commons-io 2.4 test org.bouncycastle bcprov-jdk15on 1.55 org.bouncycastle bcmail-jdk15on 1.55 org.bouncycastle bcpkix-jdk15on 1.55 log4j log4j 1.2.17 com.levigo.jbig2 levigo-jbig2-imageio 1.6.5 test com.github.jai-imageio jai-imageio-core 1.3.1 test com.github.jai-imageio jai-imageio-jpeg2000 1.3.0 test I added the dependencies you suggest (I think) in https://pdfbox.apache.org/2.0/dependencies.html. After some debugging I came up with this stack trace: org.apache.pdfbox.filter.MissingImageReaderException: Cannot read JPEG2000 image: Java Advanced Imaging (JAI) Image I/O Tools are not installed at org.apache.pdfbox.filter.Filter.findImageReader(Filter.java:128) at org.apache.pdfbox.filter.JPXFilter.readJPX(JPXFilter.java:87) at org.apache.pdfbox.filter.JPXFilter.decode(JPXFilter.java:57) at org.apache.pdfbox.cos.COSInputStream.create( COSInputStream.java:69) at org.apache.pdfbox.cos.COSStream.createInputStream( COSStream.java:162) at org.apache.pdfbox.pdmodel.common.PDStream.createInputStream(PDStream. java:235) at org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject. (PDImageXObject.java:160) at org.apache.pdfbox.pdmodel.graphics.PDXObject. createXObject(PDXObject.java:70) at org.apache.pdfbox.pdmodel.PDResources.getXObject(PDResources.java:409) at org.apache.pdfbox.contentstream.operator.graphics.DrawObject.process( DrawObject.java:53) at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator( PDFStreamEngine.java:829) at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators( PDFStreamEngine.java:486) at org.apache.pdfbox.contentstream.PDFStreamEngine. processStream(PDFStreamEngine.java:460) at org.apache.pdfbox.contentstream.PDFStreamEngine. processPage(PDFStreamEngine.java:150) at org.apache.pdfbox.rendering.PageDrawer.drawPage( PageDrawer.java:189) at org.apache.pdfbox.rendering.PDFRenderer.renderImage( PDFRenderer.java:145) at org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI( PDFRenderer.java:94) It is trying to get a reader for "JPEG2000" and can't find it. Am I missing something to make it work? or should I think that the pdf file has some "unusual" image inside it? Thanks in advance for your help. Best Regards. Jorge Flórez - To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org
Re: (JAI) Image I/O Tools are not installed
Hi Maruan, thank you for your reply. Yes, I already had a look at that page, from that I took the dependencies I put in the pom I showed in my mail. I am getting the error even when the suggested dependencies are set. Regards. Jorge Flórez 2017-02-28 11:43 GMT-05:00 Maruan Sahyoun: > Hi, > > please take a lookt at https://pdfbox.apache.org/2.0/dependencies.html > under Optional Components/JAI Image I/O > > Hope that helps. > > Best regards > > Maruan > > > > Am 28.02.2017 um 17:19 schrieb jorgeeflorez . < > jorgeeduardoflo...@gmail.com>: > > > > Hi all, > > > > I am getting some errors with version 2.0.4. In a small maven project I > set > > up, when I try to render a page from a PDF file, I get this in console: > > > > ERROR [main] (PDFStreamEngine.java:866) - Cannot read JPEG2000 image: > Java > > Advanced Imaging (JAI) Image I/O Tools are not installed > > > > This is the pom for the project: > > > >UTF-8 sourceEncoding> > >1.8 > >1.8 > > > > > > > >org.apache.pdfbox > >pdfbox > >2.0.4 > > > > > >org.apache.pdfbox > >pdfbox-tools > >2.0.4 > > > > > >junit > >junit > >4.12 > >test > > > > > >commons-logging > >commons-logging > >1.2 > > > > > >commons-io > >commons-io > >2.4 > >test > > > > > >org.bouncycastle > >bcprov-jdk15on > >1.55 > > > > > >org.bouncycastle > >bcmail-jdk15on > >1.55 > > > > > >org.bouncycastle > >bcpkix-jdk15on > >1.55 > > > > > >log4j > >log4j > >1.2.17 > > > > > > > >com.levigo.jbig2 > >levigo-jbig2-imageio > >1.6.5 > >test > > > > > >com.github.jai-imageio > >jai-imageio-core > >1.3.1 > >test > > > > > >com.github.jai-imageio > >jai-imageio-jpeg2000 > >1.3.0 > >test > > > > > > > > I added the dependencies you suggest (I think) in > > https://pdfbox.apache.org/2.0/dependencies.html. > > > > After some debugging I came up with this stack trace: > > > > org.apache.pdfbox.filter.MissingImageReaderException: Cannot read > JPEG2000 > > image: Java Advanced Imaging (JAI) Image I/O Tools are not installed > >at org.apache.pdfbox.filter.Filter.findImageReader(Filter.java:128) > >at org.apache.pdfbox.filter.JPXFilter.readJPX(JPXFilter.java:87) > >at org.apache.pdfbox.filter.JPXFilter.decode(JPXFilter.java:57) > >at org.apache.pdfbox.cos.COSInputStream.create( > COSInputStream.java:69) > >at org.apache.pdfbox.cos.COSStream.createInputStream( > COSStream.java:162) > >at > > org.apache.pdfbox.pdmodel.common.PDStream.createInputStream(PDStream. > java:235) > >at > > org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject. > (PDImageXObject.java:160) > >at > > org.apache.pdfbox.pdmodel.graphics.PDXObject. > createXObject(PDXObject.java:70) > >at > > org.apache.pdfbox.pdmodel.PDResources.getXObject(PDResources.java:409) > >at > > org.apache.pdfbox.contentstream.operator.graphics.DrawObject.process( > DrawObject.java:53) > >at > > org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator( > PDFStreamEngine.java:829) > >at > > org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators( > PDFStreamEngine.java:486) > >at > > org.apache.pdfbox.contentstream.PDFStreamEngine. > processStream(PDFStreamEngine.java:460) > >at > > org.apache.pdfbox.contentstream.PDFStreamEngine. > processPage(PDFStreamEngine.java:150) > >at org.apache.pdfbox.rendering.PageDrawer.drawPage( > PageDrawer.java:189) > >at > > org.apache.pdfbox.rendering.PDFRenderer.renderImage( > PDFRenderer.java:145) > >at > > org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI( > PDFRenderer.java:94) > > > > It is trying to get a reader for "JPEG2000" and can't find it. Am I > missing > > something to make it work? or should I think that the pdf file has some > > "unusual" image inside it? > > > > Thanks in advance for your help. > > > > Best Regards. > > > > Jorge Flórez > > > - > To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org > For additional commands, e-mail: users-h...@pdfbox.apache.org > >