Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Save Open XML as PDF

As part of an investigation into enterprise level server side document generation I have come across Open XML.

  1. For those that have used this, how successful were you? Would you recommend it?
  2. Can you save the OpenXML to PDF directly or would I need to make use of a 3rd party component?
  3. If a 3rd Party component is required, which one did you use and which one would you recommend?

Thanks

Gineer

like image 408
Gineer Avatar asked Sep 06 '10 13:09

Gineer


People also ask

Can I save XML as PDF?

Open the XML file by clicking the Office Button-> Open and searching for the file on the computer. Click on Office Button->Print and in the Print window select novaPDF from the drop-down list. Click OK then OK again in the Save PDF File As window and the XML will be converted.


3 Answers

The nice thing about the Office OpenXML is that it's the language of Microsoft Office -- if you live your "office life" in Word and Excel (2007 and later), that's the format you want.

Can you "save" OpenXML directly to PDF? No, it needs to be rendered by some third-party component.

If you're doing document generation on the server side and you don't need to be working with Office documents as output, you'd generally use something like iText or iTextSharp, which would render the PDFs directly.

I haven't worked with a server-side component that will do the translation from Office OpenXML to PDF, though.

like image 116
Dave Markle Avatar answered Oct 18 '22 09:10

Dave Markle


There are various third party components for the OpenXML to PDF piece. I maintain the open source docx4j, which is one option.

If you are doing document generation, you may find you need repeats and conditionals. For suggestions on how to do this, see http://dev.plutext.org/svn/docx4j/trunk/docx4j/sample-docs/databinding/conventions.html

like image 43
JasonPlutext Avatar answered Oct 18 '22 09:10

JasonPlutext


Call me biased, as I worked on this component, but the PDF Conversion Services are used by many small and large organisations to convert OpenXML as well as many other formats to PDF using a friendly Web Services interface.

Check out these examples:

  • C# / .NET
  • Java
like image 22
Jeroen Ritmeijer Avatar answered Oct 18 '22 10:10

Jeroen Ritmeijer