1

I have been reading a lot of questions about convert doc files to pdf but I haven't read any response which solve my problem.

I tried ASPOSE, which is really good for what we want but it is really expensive and my boss doesn't want to spend a lot of money.

I need to open a docx file, manipulate it and save as pdf. My boss doesn't want the system save the file as docx and then convert to pdf.

Anyone has a simple solution to do that?

Thank you in advance.

PS: We have abcpdf and asppdf components but I didn't find any documentation about open a pdf file and save it as doc

pnuts
  • 58,317
  • 11
  • 87
  • 139
Calango
  • 155
  • 2
  • 15
  • Check this : http://stackoverflow.com/questions/6822859/how-to-read-pdf-files-in-vb-net-or-convert-pdf-to-word-document-in-vb-net – Amen Ayach Feb 21 '12 at 11:46
  • 2
    @AmenAyach I read about IText but it doesn't convert word to pdf or vice-versa. _I quote: iText can convert an XML or an HTML file to PDF, but only on a very basic level. Converting documents from one format to another is outside the scope of iText. **And no: iText does not convert Word documents to PDF!** ._ – Calango Feb 21 '12 at 11:53

2 Answers2

2

If your boss wants to open a .DOC and save as .PDF then maybe Word or Word automation will help.

Newer versions of Microsoft Word are able to produce PDFs.

EDIT

Here are some links to sample code:

How do I convert Word files to PDF programmatically? (see accepted answer)

Word Doc to PDF Conversion. Command line using VBScript and automation

Community
  • 1
  • 1
Bobrovsky
  • 13,789
  • 19
  • 80
  • 130
  • in this case we need to install the office on the server machine to be able to use the interop. But How can I do that? Do you have any code example? – Calango Feb 22 '12 at 14:26
0

You can use iTextSharp to read the content and manipulate it then use openxml sdk to create word document from the read information.

Openxml SDK:

http://openxmldeveloper.org/ 
Zaki
  • 5,540
  • 7
  • 54
  • 91
  • That is the problem, my boss wants to OPEN the .doc file manipulate and save as .pdf. The .doc file is a template file, and I think it is too much things to do if I copy the file, open, change it, save and then convert from .doc to .pdf. – Calango Feb 21 '12 at 13:46
  • Store the templates in a table (as HTML). This way it prevents those stupid users from making changes ;) – Matt Feb 21 '12 at 15:45
  • @cristiam: thought you wanted to convert pdf files to doc..."I need to open a pdf file, manipulate it and save as docx." – Zaki Feb 22 '12 at 09:17
  • @Sam1 Thank you to tell me, I wrote wrong the question. Now it is fixed. – Calango Feb 22 '12 at 14:24