Acrobat restriction - c#

I want to add some function to manipulate PDF file such as creating or editing annotation. I searched the web and found one forum to indicated that there are acrobat-forms which check itself if they are modified by third party tools and if it's so then you can't show the pdf via adobe reader. The forum was posted on April in 2010. Is it still same?

Your forum is correct. However things are changing over time so the particular restrictions in place are not constant.
Some features would be very useful in a PDF but Adobe define them as "Extended Features". This means that they are enabled in Acrobat Reader but only if the PDF was created using Acrobat Pro.
This means that Adobe can continue to provide a free reader but at the same time encourage people to purchase Acrobat Pro since only it can be used to create this type of document.
The way this is detected is via a digital signature inserted into the PDF. If the signature is not present or has been invalidated by modifying the document then you will see a message along these lines.
“This document enabled extended features in Adobe Reader. The document
has been changed since it was created and use of extended features is
no longer available. Please contact the author for the original
version of this document.”
In the past the key extended feature which was restricted this way was the ability to save changes to forms and fields. However as of the release of Acrobat Reader XI this is no longer the case.
Acrobat Reader XI provides features to save eForms out of the box. Provided you are using this version of Acrobat you will be able to fill in and save standard PDF forms. The only problem you may have relates to older versions of Acrobat Reader which did not have this feature.
There are other extended features which can be similarly made specific to a particular PDF created by a particular tool. No doubt these will change over time as the market evolves..
In theory it is possible to license Adobe's digital certificate so you can create similar documents. We (at ABCpdf .NET) attempted to do this some years ago but without success. I believe that SAP is the only company ever to have done this.
I think that would have to be classified as the definitive answer. Even if I do say so myself. ;-)

Related

How to add an updateable header/footer with iTextSharp/C#

I want to be able to add a 'Page x of y' footer with iTextSharp that can then be updated and manipulated using the Header & Footer options in Adobe Acrobat. After the pdf is generated, users may still manually add or remove some pages, so I want them to be able to update the footer easily.
I've found quite a few resources showing how to add some text as a header or footer using PageEvent and GetOverContent(). However, once the pdf is generated, these are just plain text and aren't actually a header or footer object that can be updated in Acrobat without changing the text on each one.
Anyone know how to either:
a) access an existing pdf's header/footer objects via iTextSharp, or
b) create an actual header/footer object that Acrobat can manipulate
I'm using v5.4.3.0 - thank you
I won't downvote the question, but IMHO it's not an eligible question for StackOverflow. You may expect counter-questions such as "what have you tried."
As I'm the original developer of iText, let me explain why your question isn't a support question, but rather a request for consultancy.
PDF is defined in an ISO standard, ISO-32000-1. This standard is implemented by many companies, Adobe being the original creator of the spec, is one of them, iText Software is another.
You're asking for functionality that isn't part of the spec. You're asking about a specific implementation that is proprietary to Adobe. When using the Header & Footer functionality, Acrobat creates an Artifact (/Artifact <</Type /Pagination /Contents (Test) /Subtype /Header >>) and it stores the content stream of this artifact in a way that isn't part of the standard. (I've just read the draft for ISO-32000-2, the specification for PDF 2.0 we'll discuss at the meeting of the ISO committee in a couple of weeks, and I didn't encounter it.)
If you'd want to mimic this behavior using iTextSharp, you'll have to guess the procedure used by Adobe and implement it in iTextSharp (assuming that you're allowed to reverse engineer that procedure; I think it would be legal as it would improve interoperability). I'm pretty sure this is the closest answer to your question you'll get on this forum. It's now up to you to decide: will I implement this myself, or will I hire somebody to do this?
If you want to hire somebody at iText, please note that you'll need a license for your use of iText 5.4.3 before we'll consider your request.

Extract text form pdf using Foxit SDK

I am using Foxit SDK to extract the text from Pdf document .
Everything is okay but when I extract a pdf in other languages rather than English I don't get the correct output .
I have also used PDFBox in java but that gives me the worst output, output from Foxit SDK is better than PDFBox.
Are there ant other libraries which can solve the issue..?
Or there is some other solution.
Personally if you want it done right you have to pay for it. ComponentOne has a PDFViewer for WPF. Not sure what framework your working with since your tag is missing one.
ComponentOne PDF Viewer for WPF
You might want to try the trial version of Quick PDF Library to see how it performs on your documents. http://www.quickpdflibrary.com
QP.GetPageText(7) or GetPageText(8) returns pretty good results for most PDF files.
Andrew.
Disclaimer: I do some consulting work for Quick PDF Library.
If you are on windows, you can use the IFilter that adobe provides. Me, I used the IFilter adobe provides with the adobe reader 8.
Here is a link to the exact example I used
http://www.codeproject.com/Articles/13391/Using-IFilter-in-C
The performance was okay (I think. I haven't used many other methods). Takes about 15 sec for a 400 page PDF.

hosting a PDF in a c# application

I am creating an ebook for a friend. He has the content in word (docx) so I have a few questions. I created a thread earlier on how to approach this and the best response was to create PDF's out of it. The main point of this was so we can have insertable textboxes, links, and table of contents.
Now I was wondering if I can host the pdfs in my application. I want to make an "adobe reader" basically. Is there a library out there that does this? Can I use installed COM/dlls to do this?
The reason for this is that I was to create like a "quiz" section on my application, or a "report card" or even a "bookmark" feature.
Thanks guys.
Making a custom PDF browser control could be an extremely challenging task. You could instead use the real Adobe Reader in your application as it is provided as a COM control which could be hosted in any Windows application. Here are the steps:
Start a new WinForms application
Make the Acrobat control available in the toolbox (Tools -> Add/Remove Toolbox Items: turn on "Adobe Acrobat 7.0 Browser Document" in COM Components tab). Don't forget to grab a cup of coffee before clicking on the COM tab.
Drag the control to the form
Manipulate it:
axAcroPDF1.LoadFile("mypdf.pdf");
axAcroPDF1.Show();
I know this has been asked before, but I can't remember where. The accepted answer was something along these lines:
It would be a very bad idea to create your own PDF reader, because:
you are not in control of when Adobe
changes specs
Adobe provides a
reader free of charge, and most
users already have it installed.
Given the previous two statements, why would you want to spend that much time on reinventing the wheel? It makes sense to reinvent the wheel when you can improve upon it, but not when you are just copying functionality that is freely available.
It would be far better to find a way to use the Acrobat reader that they have already designed, and distribute free of charge.
This is very easy to do. All you need to do us use the WebBrowser control (assuming this is WinForms) and set the DocumentSource to the PDF file. The WebBrowser control will just automatically use whatever pdf reader is already installed on the client PC, just as would Internet Explorer.
I've had very good experiences working the the Aspose libraries. They're affordable and will save you a lot of time.
You can embed Adobe Reader in your apps via the ActiveX component that is installed on your machine along with the reader. You can add it to your VS Toolbox from the COM Components tab. Anyone who has Abobe Reader installed will then be able to use your app to view PDF documents.
Note that if there is not Adobe Reader installed your program will not work, or you need somehow to provide the lib with the application.
If you want something that does not require Adobe Reader then you may like to check out the iText#.
A potential problem with using a Adobe ActiveX/com component is that the user must have Adobe Reader installed for this to work (I don't think you're able and/or allowed to redistribute the activeX control only and wouldn't want to force my users to install Adobe Reader). So for more serious work I would try to use a Pdf library that you can distribute with your code such as writing a (presumably very small) P/Invoke wrapper for the open source library http://ccxvii.net/mupdf/ or if you can/want afford it use some commercial library.
An problem with using a webbrowser control is that you have to be careful to test what happens if a target user as embedding of pdf disabled in IE. It can happen that instead of embedding you get a external adobe reader (or whatever is registered as pdf handler) pop up! There might be a workaround, but I've been bitten by this before (resulting in one of those "works on my machine" problems)

How to highlight text in Pdf Winforms C#

I have a pdf file which I want to open in a Windows Forms Application and perform following tasks-
View the pdf document
Zoom +/- document
Search Text
Highlight a specific text
Show it in a listbox/dropdown
select those words and highlight in pdf
Remove selection/Highlight.
I have tried using certain libraries like pdfSharp/iTextSharp even Acrobat Reader OCX control.
Its really bugging me..is there any help??
I'd suggest looking at some means of converting the PDF if you don't have a direct need to edit it. Even then, it may be easier to convert to a different form, make changes, and then convert back. PDF is a form of PostScript, which makes it powerful, but also makes it a mess to deal with and my personal preference is to skip that headache. Not always avoidable (had a lot of fun creating Thai support in PDF print#home ticket creation once without bloating the document beyond unusable), but highly recommended where possible.
Anyways, there are a variety of PDF conversion libraries out there, some of which may be available for .NET. Worst case, you may need to create a managed C++ layer to allow your C# code to access them.
Doesn't acrobat reader OCX already have all those features ? What exactly doesnt the OCX do that you need to do in your code ?
You might try contacting Adobe and getting their full SDK for PDF. It might have controls which you can use to solve your problem.
Come to think of it , is there even an SDK for PDF from Adobe ?
You have not mentioned your preference of using Free or Commercial PDF Viewer option. If you are open to use Commercial PSF viewer, you may evaluate SyncFusion PDF Viewer control, Telerik PDF Viewer, Dynamic PDF Viewer or TallComponents. I have checked feature set and all seem to have features you are looking for. I do not represent or promote any of these SDKs, I have used TallComponents and Dynamic PDF for PDF manipulation and both have excellent support, I would say PDF Veterans in .NET space.

Generating a PDF document based on a Microsoft Word Template [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I need to take a Word document that is a template of sorts...collect user input to populate specific fields in that template..then generate a PDF file that includes the completed template as well as a few other document types. Does anyone have a good suggestion on a component to achieve this? Preferably one that does not require Microsoft Office to be installed on the web server.
Try Aspose Words for .net. From their website: "Aspose.Words enables .NET and Java applications to read, modify and write Word® documents without utilizing Microsoft Word." Utilizing Aspose Words with Aspose PDF permits you to output to PDF.
One thing you do NOT want to do is install MS Word on your production server. Loading those objects is SLOW and EATS memory. You won't be able to use the CutePDF Writer unless you also install MS Word on the server. Yeck.
Is there a reason to use Word? If you start with a PDF with Form fields, you can either allow the user to fill out the fields, or do it programatically with iTextSharp's PDF stamper.
If you need to use MSOffice 2000/2003 components programmatically, you can try Office Web Components. They do need to be installed on the server, but can be used by .NET and Com apps to interact with office file types. More info here...http://en.wikipedia.org/wiki/Office_Web_Components
If you dig about on an office CD you should find the OWC installer for your version. I haven't worked with 2007, but I assume there is something similar available.
iTextSharp and OWC are no-cost, check the licensing for more details.
Hmmm...You might be able to employ CutePDF printer in a creative way to solve this problem. Essentially, it takes anything that can be fed through a standard print driver and makes a PDF out of it. It's free.
Try using The Apache POI API to populate the fields. It can get into Word documents and access their elements.
As for the Word -> PDF step, I'd also recommend evaluating the Aspose solution. It may even be able to perform both steps. Its not free, however.
My first thought for a "doc template" + merge to pdf solution would be to start with open office formats. - the odt file (open document template) is xml-based - so you could even use perl, to do the merge, then call writer's doc 2 pdf (I have no idea if they have an API, but one could find out in less than a day - even if one had to examine the source.)
and converting your "word" dot to a writer odt file is just a "file save as" operation in OoWriter.
If you use Aspose.Words, then your input document/template can be in one of the several supported formats including DOC, DOCX.
Then you can insert data into the document in a number of ways. You can use bookmarks in a document and just set their text. Or better yet use the reporting engine we provide. It allows to use standard MS Word MERGEFIELD fields plus adds capabilities for repeating regions and even nested. E.g. you can design an invoice (with parent/child data) template in MS Word and then populate from a .NET DataSet in one line of code.
Also, you only need Aspose.Words to produce PDF (a year ago you needed both Aspose.Words and Aspose.Pdf). You can also easily save the exactly the same looking document to DOC, DOC, DOCX and a few other formats.
I'm on the Aspose.Words dev team.
Have a look at the Muhimbi PDF Converter Web Services. It runs on Windows as a service, but can be accessed from any non-Windows web services capable environment including Java and .NET.
Although this solutions requires MS-Office to be installed on a server (not necessarily the same server as your application), it is very robust and provides perfect conversion fidelity.
To generate or Modify MS-Word files I recommend using the free Open XML SDK for Microsoft Office. Eric White maintains a really good Blog about it.
Disclaimer, I worked on this product. Having said that, it works great.

Categories