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
547 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

This article is in response to a question here (http://www.experts-exchange.com/Other/URLs/Q_28283850.html) at Experts Exchange. The Original Poster has a scanned signature and wants to make the background transparent so that the signature may be pl…
Update 21-May-2015: I temporarily removed the source code to make major changes to the program. Regards, Joe In a previous Experts Exchange article, How To Rename-Move a Batch of PDF Files Based on Contents of the Files (http://www.experts-exchan…
In this video, we show how to perform Bates Numbering/Stamping of PDF documents using Power PDF Advanced, the newest product from the Document Imaging division of Nuance Communications. There are two editions of Power PDF — Standard and Advanced. Th…
In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

744 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

14 Experts available now in Live!

Get 1:1 Help Now