B4J Library jPDFjet

jmon

Well-Known Member
Licensed User
Longtime User
I think you should start a new thread for this. It's not related to the library PDFJet.
I think the problem comes from your code, you are actually putting an image for each row at column 3 in your code.
 

Phayao

Active Member
Licensed User
Longtime User
Sorry, I have to disagree - when I do not use PDFTable.WrapAroundCellText, the table with the pictures is OK. But of course then then text is jumbled up, like this:


Therefore it's clearly a problem with the library in my opinion.
Or in other words: It seems not possible to have an image in a table row when using PDFTable.WrapAroundCellText - can somebody confirm or disproof this ?

Thank you,
Chris
 

alwaysbusy

Expert
Licensed User
Longtime User
I used the exact code as in the real java example and then no blank page is printed at the end:

B4X:
Do While True
        PDFTable.DrawOn(PDFPage)
        If Not(PDFTable.HasMoreData) Then
            PDFTable.ResetRenderedPageCount
            Exit
        End If
        PDFPage.Initialize(PDFjetPDF1, PDFjetConstants1.PageSize.A4_PORTRAIT)
Loop
 
Last edited:

alwaysbusy

Expert
Licensed User
Longtime User
Trying to print a Barcode, I get an error:

B4X:
print clicked
Error occurred on line: 97 (ABMPrint)
java.lang.NoClassDefFoundError: com/pdfjet/BarCode
    at uk.co.martinpearman.b4j.pdfjet.BarCodeWrapper.Initialize(BarCodeWrapper.java:25)
    at abmaterial.ab.com.abmprint._printtopdf(abmprint.java:304)
    at abmaterial.ab.com.comptreetablepage._btnprint_clicked(comptreetablepage.java:80)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:607)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:228)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:158)
    at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:90)
    at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:462)
    at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:417)
    at abmaterial.ab.com.comptreetablepage._page_parseevent(comptreetablepage.java:1109)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:607)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:228)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:158)
    at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:90)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:84)
    at anywheresoftware.b4j.object.WebSocketModule$Adapter$1.run(WebSocketModule.java:126)
    at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30)
    at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26)
    at anywheresoftware.b4a.ShellBA.startMessageLoop(ShellBA.java:111)
    at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:131)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:300)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:158)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:90)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:84)
    at abmaterial.ab.com.main.main(main.java:29)
Caused by: java.lang.ClassNotFoundException: com.pdfjet.BarCode
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 46 more

Printing tables and so on seems to work great!



The code I use:

B4X:
Dim code As PDFjetBarCodecode.Initialize(code.CODE39, "123456789")
code.setPosition(0.0, 0.0)
code.setModuleLength(0.75)
code.setFont(PDFFont)
code.drawOn(PDFPage)
 

DonManfred

Expert
Licensed User
Longtime User
Trying to print a Barcode, I get an error

See Post #1

 

alwaysbusy

Expert
Licensed User
Longtime User
Can anyone who has a license of PDFJet try to print a 1D barcode? It's the only reason I would need to buy it. If I try it with the evaluation version (should do everything the licensed one does, no?) it seems to have found the BarCode class, but then the method drawOn() does not exist:

B4X:
print clicked
Error occurred on line: 101 (ABMPrint)
java.lang.NoSuchMethodError: com.pdfjet.BarCode.drawOn(Lcom/pdfjet/Page;)V
    at uk.co.martinpearman.b4j.pdfjet.BarCodeWrapper.DrawOn(BarCodeWrapper.java:21)
    at abmaterial.ab.com.abmprint._printtopdf(abmprint.java:316)
    at abmaterial.ab.com.comptreetablepage._btnprint_clicked(comptreetablepage.java:80)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:607)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:228)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:158)
    at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:90)
    at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:462)
    at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:417)
    at abmaterial.ab.com.comptreetablepage._page_parseevent(comptreetablepage.java:1109)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:607)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:228)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:158)
    at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:90)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:84)
    at anywheresoftware.b4j.object.WebSocketModule$Adapter$1.run(WebSocketModule.java:126)
    at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30)
    at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26)
    at anywheresoftware.b4a.ShellBA.startMessageLoop(ShellBA.java:111)
    at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:131)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:300)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:158)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:90)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:84)
    at abmaterial.ab.com.main.main(main.java:29)
 

warwound

Expert
Licensed User
Longtime User
Which version of PDFjet are you using?
The last time i had access to the paid for version of PDFjet it was version 5.07 and the native PDFjet BarCode class certainly had a drawOn(Page page) method.
I've attached the version 5.07 javadoc for you info.
 

Attachments

  • PDFjet-ForJava-v5.07-docs.zip
    155.9 KB · Views: 509

warwound

Expert
Licensed User
Longtime User
Ah that explains it.
I doubt you'll find a download link for an old version of the demo.
I could let you have the b4j library source if you want to modify it to work with your version of the demo?
Or perhaps another forum member has demo version 5.07 and could let you have a copy...
 

khaleel

Member
Licensed User
Longtime User
Hello, I tried this demo and its okay.
but when chnaging some text in the "world-communications.txt" file to some Arabic text,
this text did not show when previewing the .pdf file using adobe

Any idea about why is this and what should I do to show Arabic text ?
 

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
Hello!

I downloaded the PDF Evaluation version from PDFJET webpage and every Demo failed, after i downloaded the compiled version that Warwound all of them worked, it seems that the wrapper is now outdated. Just a comment.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…