I'm currently working with Microsoft.Office.Interop.Word to open a .docx file and convert to PDF. In order to do that, I'm doing this :
Opening the .docx file with Microsoft.Office.Interop.Word.Documents.Open()
Exporting this document as a PDF with Microsoft.Office.Interop.Word._Document.ExportAsFixedFormat()
I used this method ("Call the Protect method of the Microsoft.Office.Interop.Word.Document that you want to protect") : https://msdn.microsoft.com/library/ms178793(v=vs.110).aspx
I have my PDF file, but I can open it in Microsoft Word and edit it... I don't want this PDF to be editable and I must use Word automation to make the PDF.
My question is in the title:
How to disable Word 2013 PDF edition?
It's not possible to change the way Word converts to PDF. There are some options that can be set, using the method you use, but the basic code can't be changed. If you want special things it might be worthwhile to invest in Adobe Acrobat and/Or its API. Since PDF is Adobe's file format its product will have all the special things - it doesn't license some of these things to third parties (such as Microsoft).
Related
Its a general scenario when we provide an option of attaching a file (MS .doc) to end user. This file is stored in DB as binary. When user try to access this attachment next time, we allow them to download it. Now, here I want to give a feature to user where he should be able to open this doc file on click, edit it and save it without downloading.
.doc is a binary format and not easy to work with - a library such as Aspose, as mentioned by Christian, is definitely the way to go.
However, if .DOCX is acceptable (and that's Office 2007 and higher), then you can achieve what you want in three steps:
Convert .docx to HTML
Convert Word to HTML then render HTML on webpage
Display the HTML using any rich text control of your choice
What is the best rich textarea editor for jQuery?
Finally, convert HTML back to .docx:
Convert Html to Docx in c#
You would have to "reinvent" Microsoft Office Online (look into your skydrive account). I am unsure if there are any "out of the box" libraries for that, but you could build a simple editing app by leveraging Aspose word (or some other library). But that would be far from simple.
Link to aspose: http://www.aspose.com/.net/word-component.aspx
Word will only open files that are locally stored. What you are looking for is something similar to editing items that SharePoint provides using the WebDAV interface.
You may be able to use this approach to support your requirement. You should be cautious about the security aspects of the solution unless you have fully authenticated access to the shared folder on the server.
I am not sure if a standalone MS Word Document editor exists. However, this can be done with using a combination of rich text formatting / converting tool (for example, the DevExpress ASPxHtmlEditor + Document Server):
Load binary data from a DB;
Import loaded data (MS Word content) as HTML content into the ASPxHtmlEditor;
Edit imported data via the WYSIWYG ASPxHtmlEditor;
Convert the edited HTML back to MS Word content;
Save the converted / edited MS Word content back to the DB.
I believe, it is possible to do something like this if you have such products (free or commercial analogs) in your project.
My objective is to make an automated server-side process to turn a .ppt into a .pdf. Microsoft themselves suggested that I use OpenXML, and now I'm looking at that.
My question is:
Can I actually achieve my objective using OpenXML?
I'm having a hard time finding the methods that I'd expect, such as "save as" here
Or perhaps I'm just misunderstanding how it all works?
... to turn a .ppt into a .pdf. Microsoft themselves suggested that I use OpenXML ... Can I actually achieve my objective using OpenXML?
For the conversion of a .ppt into .pdf? I'm curious to see where you have read this ;-)
No It's just impossible using OpenXml SDK:
OpenXml SDK permits to create, modify OpenXml documents (.pptx in case of PowerPoint) and here you are talking about .ppt (Biff format)
There is NO method for converting as PDF. OpenXml SDK permits to retrieve, create, modify the content of the document Without an Office Application but DOES NOT contain any methods to render it, or such Office Application methods such as SaveAs() ...
No, a common way to convert Office documents as pdf is to use Office.Interop.
This thread How do I convert Word files to PDF programmatically? is related to Word but it can help you, it's the same with PowerPoint.
I need to highlight some random text to my PDF file. My friend advised me to convert the PDF to a Word document and parse the doc and do the highlighting before converting back to PDF.
Is there any way to this highlighting of text?
Any 3rd party library that can be use to convert PDF to doc and vice versa. Thanks.
You can use Aspose dll 's which has option to convert pdf file to word and vice versa.
For highlighting of specific words you can use BytesCout.pdfextractor dll to find the location of the searched word.Once you have find the location of word you can easily highlight it.
Conversion of PDF to Word, especially if you want the resulting Word document to be easily editable, in general is not an easy task. I doubt you'll find that as free software.
Maybe you should instead look for a lib which can search PDFs and highlight text in it. It is possible in iTextSharp (free with AGPL) if you create a custom RenderListener which waits for the word you search. When it finds the word, mark it like this (thanks, pmtamal, for the link).
There of course are numerous other PDF libs which can do that, too, I'm merely predominantly using iText...
The word documents I want to parse will have a known format, defined by a word template. Users will use the word template to create the document. I need to parse data, including values from drop downs, from the word document using C#. This will be done on a SharePoint 2010 server. What is the recommended way to do this? I've seen people mention Open XML SDK 2.0; should I use that? If so, do I need to convert the .docx to XML, then parse it? In some cases, I will also have to write to the Word document, how should this be done?
Preferably a solution will support Word 2010 and 2007 but if tools for 2010 are significantly better I'd like to know that as well. Thanks.
The file extension for Office Open XML is .docx. The .docx file can be described as an archive of several different files. Files that handle what fonts, styles, objects will exist in the word document. Those files itself will be describe as XML.
I need to convert PDF files into .doc files using C#. The computer has no file system though it doesn't have Office installed. Any good ideas how I can approach this? I did some research and most of people use the interop services.
You need to understand that PDF is not really implemented as a single document format.
If your PDF docs are created by rendering text to a PDF file, then direct PDF conversion is not only possible, but can be very good (reliable).
If the source of your PDF is either a scanner or fax (essentially a scanner...) then what you have is a document with an "picture" of text. This scenario is more difficult to deal with. If you open up the markup for this there is no 'text' to be converted. In this situation you have to deal with some manner of OCR (optical character recognition) which is less reliable due to a variety of issues.
If you have the option of intercepting the data before it is rendered to PDF (say like in SSRS or Crystal) then it would be better for you to bypass the PDF stage and move your data to a Word document.
If you are constrained to receiving faxes and then needing to interpret their content, prepare for OCR hell. It has been a while since I was there, so I hope that it has gotten better.
Even with out office installed on your machine, you have access (with Visual Studios) to the Office developer toolkit which will allow you build documents to be distributed in the Word formats.(.doc/.docx).
An option/idea may be to convert the PDF to Html, which can be opened in Word?
use aspose pdf kit to conver pdf to text and then text to doc using filestream or aspose doc