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
560 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Export PDF for printing from InDesign 4 85
Outlook 2013 and Adobe 3 81
PDFs in iBook app not in a iPhone 7 restore 8 79
Adobe Connect eLearning pricing 2 44
Update 21-May-2015: I temporarily removed the source code to make major changes to the program. Regards, Joe INTRODUCTION This article presents a solution to a question (http://www.experts-exchange.com/Programming/Installation/Q_28396542.html)…
Inserting page numbers in Portable Document Files not only enhances manageability but also makes them look professional. With numbered pages, the file appears more organized and it becomes easier to search for a particular page. The size and the vol…
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…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

759 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