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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Scroll through PDF files 2 342
Remove password restriction from a PDF file. 5 118
Need graphics tool to create card game 2 137
PDF: Display my cards game? 8 110
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…
Have you ever come up with a need of emailing only few pages of PDF file to one of yourfriend or colleague, instead of whole Adobe file? If yes, then surely you have face problems in doing that! Read this section as I have suggested multiple solutio…
In this third video of the Xpdf series, we discuss and demonstrate the PDFtoText utility, which converts PDF files into plain text files. Download and install the software.: You may have already downloaded and installed the Xpdf tools while watching…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

785 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