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)
Related
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. ;-)
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.
I want to display and edit MS Excel File from client side using ActiveX COM object. The user would be allowed to edit the file and save it to local PC. Then It can be uploaded to remote server.
So, can you give me some example of displaying Word, Excel, Powerpoint etc document in Internet Explorer 8.0 using COM. I could not find such ocx files for that purpose . Can you help me finding it.
Thanks
Maksud
I think those controls would violate the MS Office distribution or EULA licensing agreements with Microsoft. Since an ActiveX control that emulates Word, Excel, PowerPoint would potentially give unlimited and anonymous users access to the software without paying for it. There's other Microsoft technologies that allow you to leverage the end-user's MS Offices licenses that allow them to save back to the web server. I think WebDAV used to be used (http://technet.microsoft.com/en-us/library/cc781730%28WS.10%29.aspx), I don't know what's out there now, but I'm sure there's a solution.
I wonder if the use of Google Docs would solve these issues. I'm pretty sure there's a way to leverage some sort of mix of Google Docs and the associated APIs to do something akin to what you are trying to do. I admit this isn't quite a perfect match for your goals.
This sounds like a use case that Office Live Workspace was created for. It's free, it's collaborative, and it allows you to determine sharing permissions.
With C#, how can I print a PDF document (without any dialog boxes in the background) to an indicated printer?
I have used the following PDF library in the past to perform batch printing of PDF documents from a C# Windows Service.
http://www.quickpdflibrary.com/
It's a pretty decent library and if I remember correctly it only took a few lines of code to print the document. It worked very well and saved me a consider amount of time.
Also, the recommended link that discusses using DDE to launch a desktop application on a server to perform the printing is a bad idea. Adobe Reader probably doesn't support this and since it is a desktop application running in a windowless session you may run into problems with message boxes and dialog boxes. That solution just doesn't scale in my humble opinion.
here we go
Disclaimer: I work for Atalasoft
If you don't want to depend on Acrobat being on the server, you need to rasterize the PDF pages yourself and send them to the printer using the normal .NET printing API. We have a product that can rasterize PDF that uses the Foxit engine underneath. It deploys as a normal .NET assembly and doesn't require any other software to be installed.
Is there any good way to use a windows application written in C# to display/control a powerpoint slideshow? Ultimately I would like to show thumbnails in a form and clicking these thumbnails would advance the slides shown on a second monitor (similar to using Powerpoint itself to show a slideshow on a second monitor).
I would like to be able to use Powerpoint Viewer if Powerpoint is not installed.
There seems to be some ActiveX-controls that allows integration of Powerpoint in a form, but most of these seem to cost money, does anyone have experience using one of these controls?
Edit: I know that there is an object model accessable by adding a reference to Microsoft.Office.InterOp.Powerpoint, but I want to be able to distribute the resulting program without having Microsoft Office as a prerequisite, that was why I mentioned Powerpoint Viewer because it can be distributed freely.
This kb lays out the basics for working with the powerpoint presentation viewer object model. I'd suggest you include the viewer when you distribute your application.
http://support.microsoft.com/kb/265385
Once you get a reference to the viewer (top level) object it is basically the same as working with the powerpoint.presentation object model, but with less functionality (i.e. editing, etc)
If you are working with Powerpoint 2007, then you can add editing functionality by using the System.XML and related namespaces to work with the presentation file as an open xml file.
Regarding the comments about UNO/openoffice.org, I think these miss the point, as you cannot use UNO for working with powerpoint, it is for openoffice and that was not the origianl requirement of the questioner.
there are 3rd party toolsets like aspose, but then your goal was to work with the powerpoint viewer component (free) so I'm guessing you want to avoid paying for dev tools? Either way viewer components OM is perfectly suitable for displaying and previewing and existing slide show. (you will need one copy of Powerpoint so that you can author the presentation from scratch, plus Visual Studio to create the VSTO project).
One of our softwares here at work does that. Initially we used MS Office but recently we switched to use OpenOffice.org Uno since it offers better control than MS Office and is easier to work with. It has .NET CLI-bindings.
To answer your question, yes it can be done but our engineers would recommend you use OpenOffice.org instead.
Just like with Microsoft Excel and Word, Powerpoint has an Object Model that you can access in code by including a reference in your project to:
Microsoft.Office.InterOp.Powerpoint.
I've used the Excel and Word models, but haven't used the one for Powerpoint. You can get a little taste of what's available by opening up the Object Browser once you've included the reference to see what kind of functionality is available. This might be a viable solution for you if you don't want to use a 3rd party tool to access the object model.
I have used the Word toolkit from Aspose -- they have a Powerpoint toolkit too that I think would be worth looking at.
http://www.aspose.com/categories/file-format-components/aspose.slides-for-.net-and-java/default.aspx