Solved

Working in .NET with extensions enabled PDFs, how can I fill them with data without loosing extended features?

Posted on 2011-03-07
2
550 Views
Last Modified: 2012-05-11
I'm trying to fill with some data an Extensions Enabled PDF form in order to show it to the end user, so he can finish it and save it.
I've tried different products, combining the form with a FDF or setting the field values by code, but when I open the generated document I always get the same error (from Adobe Reader):
"This document enabled extended features in Adobe Reader, The document has been changes since it was created and use of extended features is no longer available. Please contact the author for the original version of this document."
Is it possible to fill the form with some data and preserve the document's extensions which allows the user to fill and save the form? How?
0
Comment
Question by:DesarrolloBgn
2 Comments
 
LVL 5

Accepted Solution

by:
NKOWA earned 500 total points
ID: 35058604
Check out FDFToolkit.net.

FDFToolkit.net can merge data with a PDF and retain it's usage rights.
FDFToolkit.net uses iTextSharp technologies.

Example Code:
Public Sub TestLoadPDFAcrobat()
        Try
            Response.Clear()
            Dim cFDFApp As New FDFApp.FDFApp_Class
            Dim cFDFDoc As New FDFApp.FDFDoc_Class
            Response.ContentType = cFDFApp.MimePDF
            cFDFDoc = New FDFApp.FDFDoc_Class
            cFDFDoc = cFDFApp.FDFCreate
            cFDFDoc.FDFSetFile("http://mydomain.com/test_acrobat.pdf")
            ' SET PDF FIELD VALUES
            cFDFDoc.FDFSetValue("FullName", "My Name")
            cFDFDoc.FDFSetValue("Email", "MyEmail@gmail.com")
            cFDFDoc.FDFSetValue("City", "My City")
            cFDFDoc.FDFSetValue("State", "My State")
            cFDFDoc.FDFSetValue("Country", "My Country")
            cFDFDoc.PreserveUsageRights = True
            Dim pdfBytes() As Byte = cFDFDoc.PDFMergeFDF2Buf(cFDFDoc.FDFGetFile, False, "")
            Response.BinaryWrite(pdfBytes)
            Response.End()
        Catch ex As Exception
            'err.clear ' Throw ex
        End Try
    End Sub
    Public Sub TestLoadPDFLiveCycle()
        Try
            Response.Clear()
            Dim cFDFApp As New FDFApp.FDFApp_Class
            Dim cFDFDoc As New FDFApp.FDFDoc_Class
            Response.ContentType = cFDFApp.MimePDF
            cFDFDoc = New FDFApp.FDFDoc_Class
            cFDFDoc = cFDFApp.FDFCreate
            cFDFDoc.XDPAddForm("topmostSubform", "http://mydomain.com/test_acrobat.pdf")
            ' SET PDF FIELD VALUES
            cFDFDoc.XDPSetValue("FullName", "My Name")
            cFDFDoc.XDPSetValue("Email", "MyEmail@gmail.com")
            cFDFDoc.XDPSetValue("City", "My City")
            cFDFDoc.XDPSetValue("State", "My State")
            cFDFDoc.XDPSetValue("Country", "My Country")
            cFDFDoc.PreserveUsageRights = True
            Dim pdfBytes() As Byte = cFDFDoc.PDFMergeXDP2Buf(cFDFDoc.FDFGetFile, False, "")
            Response.BinaryWrite(pdfBytes)
            Response.End()
        Catch ex As Exception
            'err.clear ' Throw ex
        End Try
    End Sub

Open in new window


for more information visit:
http://www.fdftoolkit.net/
0
 

Author Closing Comment

by:DesarrolloBgn
ID: 35067065
Thank you. I haven't been able to test it myself (waiting for the product to be purchased) but I believe it will work.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ability to edit PDF documents can be useful, however it may not be a straight forward process. Many non-technical people don't realise that a PDF document is basically an image rather than a text file, even if it contains nothing but text. If…
*Adobe Acrobat 9 was used for this article.  Particular steps may vary depending on software versions. Adobe Acrobat has many, many variables that my be utilized to customize your forms for clarity and ease of use. The Form Editing Tool will be y…
In this first video of the three-part Xpdf series, we introduce and describe Xpdf, a library containing nine command line utilities that perform various functions on PDF files. We show where the library is located and how to download it, discuss its…
In this second video of the Xpdf series, we discuss and demonstrate the PDFimages utility, which, in a single command, is able to extract all the images from a PDF file and save each one in a separate image file (PBM, PPM, or JPG). Download and inst…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now