B4J Code Snippet make a custom PDF with Banano/SithasoDaisy

lib:
BANano
SithasoDaisy
SithasoDaisyPDF

thanks to @Mashiane

B4X:
Sub makepdf
    Log("make pdf")
    Dim jspdf As SDUIJSPDF
    jspdf.Initialize(Me, "pdfEvent", "test.pdf")
    jspdf.Start
    jspdf.SetText1("Hello World", "20", "20")
    jspdf.SetText("20", "30", "Example with Banano/SithasoDaisy and jsPDF")
    jspdf.addPage 'new page
    jspdf.SetText("40", "55", "Page number two!")
    jspdf.close
    jspdf.Save
End Sub
 

Attachments

  • Test.pdf
    3.6 KB · Views: 113

giannimaione

Well-Known Member
Licensed User
Longtime User
a preview of pdf without save it
B4X:
Sub makepdf
Log("make pdf")
Dim jspdf As SDUIJSPDF
jspdf.Initialize(Me, "pdfEvent", "test.pdf")
jspdf.Start
jspdf.SetText1("Hello World", "20", "20")
jspdf.SetText("20", "30", "Example with Banano/SithasoDaisy and jsPDF")
jspdf.addPage 'new page
jspdf.SetText("40", "55", "Page number two!")
jspdf.close
' NOT SAVE A PDF jspdf.Save
'but
pdf.getOutput(pdf.OUTPUT_DATA_URL_NEW_WINDOW) 'dataurlnewwindow open a preview of pdf !!!
End Sub
 
Last edited:
Top