Dim Job As HttpJob
Job.Initialize("Job1",Me)
Job.Download("https://www.b4x.com/android/forum/attachments/sample-pdf.85740/")
Wait For (Job) JobDone(j As HttpJob)
If j.Success = False Then Return
Dim Doc As PDDocument
Doc.Initialize("Doc")
Dim Jo As JavaObject = Doc
Doc = Jo.RunMethod("load",Array(j.GetInputStream))
Log(Doc)
Dim p1 As PDPage = Doc.GetPage(0)
Log(p1)
Added Initialize3(eventprefix, inputstream) and Initialize4(eventprefix, inputstream, password)But I don't know how it will integrate with DonManfreds Implementation of the library. Perhaps if you ask him, he will take a look at implementing load from input stream and also with password..
This nicely streamlines your recent enhancements for future users but I was fine with the inclusions in the class as that was quite educational for me. So this new wrapper is to included using the additionaljar in conjunction with the PDFBox original jar yes? that is:Added Initialize3(eventprefix, inputstream) and Initialize4(eventprefix, inputstream, password)
#AdditionalJar: pdfbox-app-2.0.19.jar
#AdditionalJar: PDFBox.jar
There are quite a few more jar's to include using this PDFBox.jar, can you share what other jar's you require us to have on our b4j libraries folder?This nicely streamlines your recent enhancements for future users but I was fine with the inclusions in the class as that was quite educational for me. So this new wrapper is to included using the additionaljar in conjunction with the PDFBox original jar yes? that is:
B4X:#AdditionalJar: pdfbox-app-2.0.19.jar #AdditionalJar: PDFBox.jar
No sorry this is to be added as a library via the tab and it is far more extensive than the wrapper I see you included many classes from the PDFBox now including Action and ActionURL etc
As I added the PDFBox library and declared pdf2 as PDFBox and the compiler gave error dependencies as shown below:There are quite a few more jar's to include using this PDFBox.jar, can you share what other jar's you require us to have on our b4j libraries folder?
#AdditionalJar: pdfbox-app-2.0.19.jar
#AdditionalJar: fontbox-2.0.17.jar
#AdditionalJar: commons-logging-1.2.jar
main._process_globals (java line: 492)
java.lang.NoClassDefFoundError: org/krysalis/barcode4j/output/CanvasProvider
at b4j.example.main._process_globals(main.java:492)
at b4j.example.main.initializeProcessGlobals(main.java:476)
at b4j.example.main.start(main.java:34)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassNotFoundException: org.krysalis.barcode4j.output.CanvasProvider
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 12 more
This is NEVER needed in b4j. It is a standalone java app#AdditionalJar: pdfbox-app-2.0.19.jar
Write one.BTW I do like the wrapper in Class form