I have written a document with writer that adds 2 numerical fields of a form with a macro.How I could to export the macro to PDF?

I have the macro in a writer document.When I change the numeric fields of the form,automatically It calculates the total result in other field of the form .I want to run this macro in a PDF document. How I could to run this macro in a PDF document?

Your pdf will be opened and presented ba any of a huge palette of pdf readers/editors different from LibrOffice which is not a software of that class itself. Even if pdf had a macro container (It hasn’t, afaik.) this alien software would not know how to execute a LibreOffice Basic macro.

In short: No “how to”, you simply can’t.