Android Question Write to exiting PDF

mcmanu

Active Member
Licensed User
Longtime User
Hello :)

I know there are Libs were you can create a PDF file.
But is it possible to write into an exitsing PDF File (an PDF Formular which has Fields in it)

in Vb.net it is possible to create an copie of the PDF file which looks the same as the Original PDF file and
you can write into the fields (textboxes of the file). Is this possible with B4A?

Regards

Manuel
 

DonManfred

Expert
Licensed User
Longtime User
Is this possible with B4A?
I don´t know any Library for this.

There are many java libraries out there but all (or most) of them are paid.
 
Upvote 0

mcmanu

Active Member
Licensed User
Longtime User
Thank you DonManfred for the Quick Reply.
Okay than i have to look for a another solution :)
 
Upvote 0

yfleury

Active Member
Licensed User
Longtime User
Hello :)

I know there are Libs were you can create a PDF file.
But is it possible to write into an exitsing PDF File (an PDF Formular which has Fields in it)

in Vb.net it is possible to create an copie of the PDF file which looks the same as the Original PDF file and
you can write into the fields (textboxes of the file). Is this possible with B4A?

Regards

Manuel

That's what I need for my next app
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
Hello :)

I know there are Libs were you can create a PDF file.
But is it possible to write into an exitsing PDF File (an PDF Formular which has Fields in it)

in Vb.net it is possible to create an copie of the PDF file which looks the same as the Original PDF file and
you can write into the fields (textboxes of the file). Is this possible with B4A?

Regards

Manuel
Yes, there are, i wrapped a library for this years ago, i will look for it and upload it, these forms are called AcroForms, the library basically takes the already made PDF file and reads the fields in the form and you can basically write content to each field, once the form is filled out the form gets flattened and you are able to open it with the regular methods and see the filled out form.

I will look for the library and upload it when i get a chance.

Regards,
Walter
 
Upvote 0

Zockolade

Member
Licensed User
Longtime User
Yes, there are, i wrapped a library for this years ago, i will look for it and upload it, these forms are called AcroForms, the library basically takes the already made PDF file and reads the fields in the form and you can basically write content to each field, once the form is filled out the form gets flattened and you are able to open it with the regular methods and see the filled out form.

I will look for the library and upload it when i get a chance.

Regards,
Walter

Hello Walter,

did you already upload this library somewhere? I also want to work with the acroforms. ;)

Regards
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
Hello Walter,

did you already upload this library somewhere? I also want to work with the acroforms. ;)

Regards
Hi Sorry i got really busy and wasn't able to rewrite the library, I believe I still have the old one somewhere just need to dig it up, i will upload it if i find it.

Walter
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
ok, that would be great.
In the meantime you can play with this quickanddirty little wrap.

Download the PDFBox jars here: https://www.dropbox.com/s/1wh9ldpumahqks5/AddLibsPDFBox.zip?dl=0

Samplecode

B4X:
    Wait For (File.CopyAsync(File.DirAssets, "acroform1.pdf", File.DirData("PDFBox"), "acroform1.pdf")) Complete (Success As Boolean)
    Log("Success: " & Success)
    box.Initialize("",File.Combine(File.DirData("PDFBox"),"acroform1.pdf"))
    box.setField("Here we have a form field","B4X rules!")
    box.setField("Just try to enter something into this field","B4X rules again ;-)")
    box.save(File.Combine(File.DirData("PDFBox"),"acroform_neu.pdf"))
 

Attachments

  • AddLibsWrapper.zip
    5.1 KB · Views: 181
  • PdfBoxEx.zip
    160.5 KB · Views: 175
  • acroform1.pdf
    165.3 KB · Views: 173
  • acroform_neu.pdf
    169.9 KB · Views: 167
Upvote 0
Top