Flattening with PDFXEditCore.x86.dll

A forum for questions or concerns related to the PDF-XChange Core API SDK

Moderators: Tracker Support, TrackerSupp-Daniel, Chris - Tracker Supp, Vasyl-Tracker Dev Team, Sean - Tracker, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
sbensen
User
Posts: 2
Joined: Wed Jun 12, 2019 1:27 pm

Flattening with PDFXEditCore.x86.dll

Post by sbensen » Wed Jun 12, 2019 1:31 pm

Hi,

We have a license for PDFXEditCore.x86.dll.

Would like to know whether this dll will support the flattening operation. If so, can you please send the usage of it. A sample code will help.



Thanks.

sbensen
User
Posts: 2
Joined: Wed Jun 12, 2019 1:27 pm

Re: Flattening with PDFXEditCore.x86.dll

Post by sbensen » Wed Jun 12, 2019 8:43 pm

Is there any way we can programmatically achieve the UI functionality of Comments->flattening, with any API calls?

We have license for the PDFXEdit version of the dll. It is highly appreciated if you can tell a way to do this using the PDF Xchange editor API’s. The below code is written in Vb.net.

Dim filename As String = "C:\pdf-to-flatten.pdf"
Dim filename2 As String = "C:\flattened.pdf"

Dim m_CurDoc As PDFXCoreAPI.IPXC_Document
Dim pdfInst As PDFXCoreAPI.PXC_Inst
Dim acroForm As PDFXCoreAPI.IPXC_AcroForm

pdfInst = New PDFXCoreAPI.PXC_Inst()
pdfInst.Init("")

m_CurDoc = pdfInst.OpenDocumentFromFile(filename, Nothing)
acroForm = m_CurDoc.AcroForm()

acroForm.FlattenAllFields() 'this line should flatten the PDF but the saved PDF(flattened.pdf) is not flatten. How can we achieve this?
m_CurDoc.WriteToFile(filename2)

User avatar
Sasha - Tracker Dev Team
User
Posts: 4089
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Flattening with PDFXEditCore.x86.dll

Post by Sasha - Tracker Dev Team » Thu Jun 13, 2019 6:34 am

Hello sbensen,

Try using the Editor SDK's https://sdkhelp.tracker-software.com/vi ... ts_flatten operation. There is a code sample on how to use that.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Post Reply