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

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

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

One of the questions I get asked again and again is how to validate a field value in an AcroForm with a custom validation script. Adobe provided a lot of infrastructure to do that with just a simple script. Let’s take a look at how to do that wit…
Update 21-May-2015: I temporarily removed the source code and the code snippets to make major changes to the program. Regards, Joe A recent question here at Experts Exchange piqued my interest, so I decided to provide a thorough solution and publ…
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 video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …

627 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