[Solved] How to create a "flatten" button for PDF form

Discuss the word processor
Post Reply
leftdefense
Posts: 3
Joined: Fri Nov 20, 2020 9:26 pm

[Solved] How to create a "flatten" button for PDF form

Post by leftdefense »

Hi,

I am currently using OpenOffice Writer to create simple PDF forms for my employees.
Howerver, legally, these forms need to be archived for a really long time.

So i need to be able to quickly convert the dynamic PDF form to a static (or flatten) PDF/A. Preferably with a single click button.
A normal flatten PDF (not PDF/A) would be okay too, since my e-sign program can convert a PDF to PDF/A.

I actually acheive this manually by using a PDF printer. It is a pain since i have to choose the printer, specify the format and create a separate file.

I was thinking about setting a button on the form that activates some code that flattens the current document. However, even though adding a button is easy, i have never coded in OpenOffice.

Can someone help me create and set the code for this button?

Thanks a lot.
Last edited by RusselB on Wed Dec 23, 2020 1:58 am, edited 3 times in total.
Reason: Answered tag changed to Solved in order to fit common search terms for solved topics
Apache Open office 4.1.7
Windows 10 Pro
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: How to create a "flatten" action button for PDF form

Post by RoryOF »

Just set the PDF/ A-1a setting in the /File /Export as PDF.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
leftdefense
Posts: 3
Joined: Fri Nov 20, 2020 9:26 pm

Re: How to create a "flatten" action button for PDF form

Post by leftdefense »

RoryOF wrote:Just set the PDF/ A-1a setting in the /File /Export as PDF.
It does flatten the .ODT form but it is not what i'm looking for.
I want to fill a PDF form (so the field must not be flatten at first) and then with a button, they go flatten.
The button that flattens the PDF form will be executed after filling the form in Adobe Reader, not in OO. (The users that will fill the form won't even have OO installed)
Apache Open office 4.1.7
Windows 10 Pro
Bidouille
Volunteer
Posts: 577
Joined: Mon Nov 19, 2007 10:58 am
Location: France

Re: How to create a "flatten" action button for PDF form

Post by Bidouille »

leftdefense wrote:The button that flattens the PDF form will be executed after filling the form
Unable to execute this kind of action.
Exported PDF with AOO can not embed any Javascript: https://bz.apache.org/ooo/show_bug.cgi?id=62843
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: How to create a "flatten" action button for PDF form

Post by Villeroy »

Just open a new instance of the same PDF
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
leftdefense
Posts: 3
Joined: Fri Nov 20, 2020 9:26 pm

Re: How to create a "flatten" action button for PDF form

Post by leftdefense »

Bidouille wrote:
leftdefense wrote:The button that flattens the PDF form will be executed after filling the form
Unable to execute this kind of action.
Exported PDF with AOO can not embed any Javascript: https://bz.apache.org/ooo/show_bug.cgi?id=62843
It's what i thought... to do what i want, we would need to run Javascript right?
This is so sad for me :(

Thanks for the answer Bidouille.
Apache Open office 4.1.7
Windows 10 Pro
Post Reply