Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Flatten Annotations
  FAQ FAQ  Forum Search   Register Register  Login Login

Flatten Annotations

 Post Reply Post Reply
Author
Message
CrazyTIm View Drop Down
Team Player
Team Player
Avatar

Joined: 21 Aug 11
Location: Australia
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote CrazyTIm Quote  Post ReplyReply Direct Link To This Post Topic: Flatten Annotations
    Posted: 01 Nov 12 at 3:46AM
Hi,

QuickPDF API has a function FlattenFormField... what about annotations (lines, text, etc) or will these be flattened as well when I use FlattenFormField?

My problem is that I need to flatten annotations because they cannot be seen using the native PDF viewer on the iPad.

Regards, Jason.
Back to Top
CrazyTIm View Drop Down
Team Player
Team Player
Avatar

Joined: 21 Aug 11
Location: Australia
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote CrazyTIm Quote  Post ReplyReply Direct Link To This Post Posted: 01 Nov 12 at 4:29AM
Note: the RenderDocumentToFile function does not render annotations either!

As part of our workflow we add markup to PDFs (annotations). We then need to see our marked-up PDFs on the iPad. Any ideas fellas?


Edited by CrazyTIm - 01 Nov 12 at 4:31AM
Back to Top
CrazyTIm View Drop Down
Team Player
Team Player
Avatar

Joined: 21 Aug 11
Location: Australia
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote CrazyTIm Quote  Post ReplyReply Direct Link To This Post Posted: 02 Nov 12 at 3:04AM
I have found a solution, but you must have Adobe Acrobat Professional installed. I am using VB.NET to reference the the Adobe Acrobat 10.0 Type Library to interface with Acrobat.

Here's my code:

Private G_PDF_App As Acrobat.CAcroApp
        ''' <summary> Flatten anotations and objects in the PDF. Warning: unreversible changes! This makes annotations viewable nativly on the iPad. </summary>
        Public Sub PDF_Flatten(ByVal Path As String)

            Try
                If G_PDF_App Is Nothing Then
                    G_PDF_App = CType(CreateObject("AcroExch.App"), Acrobat.CAcroApp)
                End If

                Dim AVDoc As Acrobat.CAcroAVDoc
                Dim PDDoc As Acrobat.CAcroPDDoc
                Dim jso As Object

                PDDoc = CType(CreateObject("AcroExch.PDDoc"), Acrobat.CAcroPDDoc)

                If PDDoc.Open(Path) Then

                    ' Create AV doc from PDDoc object 
                    AVDoc = PDDoc.OpenAVDoc("TempPDF")

                    ' Hide Acrobat application so everything is done in silent mode 
                    G_PDF_App.Hide()

                    ' Create Javascript bridge object 
                    jso = PDDoc.GetJSObject

                    Dim tg = jso.flattenPages()

                    If Not PDDoc.Save(1, Path) Then
                        Log.WriteLine("could not flatten file")
                    End If

                    AVDoc.Close(0)
                    PDDoc.Close()
                End If

                jso = Nothing
                PDDoc = Nothing

                G_PDF_App.Exit()
                G_PDF_App = Nothing

            Catch ex As Exception
                Log.WriteLine("Error: PDF_Flatten")
            End Try

        End Sub

Hope it helps!
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 02 Nov 12 at 9:02AM
We will look into adding QP.FlattenAnnotation into a future version of Quick PDF Library.

Andrew.
Back to Top
CrazyTIm View Drop Down
Team Player
Team Player
Avatar

Joined: 21 Aug 11
Location: Australia
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote CrazyTIm Quote  Post ReplyReply Direct Link To This Post Posted: 04 Nov 12 at 9:45PM
Thanks Andrew.
Back to Top
CrazyTIm View Drop Down
Team Player
Team Player
Avatar

Joined: 21 Aug 11
Location: Australia
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote CrazyTIm Quote  Post ReplyReply Direct Link To This Post Posted: 10 Jun 15 at 6:56AM
Hi Andrew, does the feature QP.FlattenAnnotation exist yet?
Back to Top
jpbro View Drop Down
Senior Member
Senior Member


Joined: 29 Mar 11
Status: Offline
Points: 77
Post Options Post Options   Thanks (1) Thanks(1)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 15 Jun 15 at 12:05AM
Yes, it was introduced in QPDF 9.14 according to the document (the function is called FlattenAnnot though, not FlattenAnnotation). See:

http://www.debenu.com/docs/pdf_library_reference/FlattenAnnot.php
Back to Top
CrazyTIm View Drop Down
Team Player
Team Player
Avatar

Joined: 21 Aug 11
Location: Australia
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote CrazyTIm Quote  Post ReplyReply Direct Link To This Post Posted: 18 Jun 15 at 2:56AM
OK, I'll check it out.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store