B4A Library PDFjetB4A

hibrid0

Active Member
Licensed User
Longtime User
Any example to create table to make a report?
I'm using the other pdf library and I'm tired with the tables.
 

Robert Valentino

Well-Known Member
Licensed User
Longtime User
AddPage - ?? Anyone get this feature to work?

Is there ANY way to make a second page?

BobVal
 

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Trying to use PDFjetTextColumn

B4X:
  Dim Box              As PDFjetBox
  Dim TextColumn  As PDFjetTextColumn
  Dim Paragraph     As PDFjetParagraph
  Dim TextLine        As PDFjetTextLine
  Dim TextFont       As PDFjetFont

 TextColumn.Initialize                                 <----- This line fails with the error below


** Activity (main) Create, isFirst = true **
Cannot get methods of class: uk.co.martinpearman.b4a.pdfjet.TextColumnWrapper, disabling cache.
Error occurred on line: 110 (Main)
java.lang.RuntimeException: Method: Initialize not found in: uk.co.martinpearman.b4a.pdfjet.TextColumnWrapper
at anywheresoftware.b4a.shell.Shell$MethodCache.getMethod(Shell.java:957)
at anywheresoftware.b4a.shell.Shell.getMethod(Shell.java:610)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:739)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:342)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:246)
 

warwound

Expert
Licensed User
Longtime User
It looks as though PDFjetTextColumn is only available with the full (paid for) version of PDFjet.
You're using the free open source version are you?
 

Robert Valentino

Well-Known Member
Licensed User
Longtime User
When I look at the Open Java Source
B4X:
  /**
  *  Creates page object and add it to the PDF document.
  *
  *  Please note:
  *  <pre>
  *  The coordinate (0f, 0f) is the top left corner of the page.
  *  The size of the pages are represented in points.
  *  1 point is 1/72 inches.
  *  </pre>
  *
  *  @param pdf the pdf object.
  *  @param pageSize the page size of this page.
  */
  public Page(PDF pdf, float[] pageSize) throws Exception {
  this(pdf, pageSize, true);
  }


  /**
  *  Creates page object and add it to the PDF document.
  *
  *  Please note:
  *  <pre>
  *  The coordinate (0f, 0f) is the top left corner of the page.
  *  The size of the pages are represented in points.
  *  1 point is 1/72 inches.
  *  </pre>
  *
  *  @param pdf the pdf object.
  *  @param pageSize the page size of this page.
  *  @param addPageToPDF boolean flag.
  */
  public Page(PDF pdf, float[] pageSize, boolean addPageToPDF) throws Exception {
  this.pdf = pdf;
  contents = new ArrayList<Integer>();
  annots = new ArrayList<Annotation>();
  destinations = new ArrayList<Destination>();
  width = pageSize[0];
  height = pageSize[1];
  buf = new ByteArrayOutputStream(8192);

  if (addPageToPDF) {
  pdf.addPage(this);
  }
  }

There are TWO page Init routines. The Second one takes a Boolean to indicate AddPageToPDF. To me this implies that we can have more than one page.

Is there anyway I can call the second init routine. The XML file has only the first init routine.

BobVal

PS: I just walked thru all the Java open source and to me it appears that AddPage and more than one page should work. But it doesn't. The two routines that do all this are PDF.java and Page.java
 
Last edited:

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Version 5.68

If I try and compile version 5.68 and use it I crash ( PDFJet has stopped working )
if I download the Evaluation version of 5.68 and try it I crash ( PDFJet has stopped working )

Does the 5.68 no longer work with B4A

BobVal
 

RUNO

Active Member
Licensed User
Longtime User
Hello
How do I change print orientation from left to right ?
I want the font type allowed to write Arabic and English.
 
Last edited:

Baris Karadeniz

Active Member
Licensed User
Can I use this library for viewing existing pdf file which is downloaded with webview? There will not be any change on the pdf file.
 

hibrid0

Active Member
Licensed User
Longtime User
Last edited:

RUNO

Active Member
Licensed User
Longtime User
Hello
How do I change print orientation from left to right ?
I want the font type allowed to write Arabic and English.
 

hibrid0

Active Member
Licensed User
Longtime User
Hello
How do I change print orientation from left to right ?
I want the font type allowed to write Arabic and English.
Right now I dont know, but will help you this sample for B4J and the PDFJet Documentation.
 

Attachments

  • jPDFjet-demo-project.zip
    67 KB · Views: 336
  • java.zip
    170.3 KB · Views: 281

Descartex

Well-Known Member
Licensed User
Longtime User
How can i use (if is possible) to use a font from File.DirAssets???
 

Descartex

Well-Known Member
Licensed User
Longtime User

mokrokuce

Member
Licensed User
Longtime User
Hello Warwound,
I am evaluating this library and I am trying to print these characters: Š Đ Č Ć Ž, but I get only first and last letter.
I am attaching generated PDF file, look at the second line.
Can you point me in the right direction what to do (I am a newbie)?

Thanks.
 

Attachments

  • pdfjet-test.pdf
    1.1 KB · Views: 339
Cookies are required to use this site. You must accept them to continue using the site. Learn more…