Why You Should Consider Aspose.Words for Microsoft Word to PDF Conversions
Blog Barista: Sokwhan Huh | August 15, 2019 | Development Tools | Brew time: 5 min
John E. Warnock, the cofounder of Adobe, had a mission in 1990. In his very conspicuously named memo “The Camelot Project,” John best summarizes the difficulty many industries faced in sharing documents:
“What industries badly need is a universal way to communicate documents across a wide variety of machine configurations, operating systems and communication networks. These documents should be viewable on any display and should be printable on any modern printers. If this problem can be solved, then the fundamental way people work will change.”
Thus, the Portable Document Format (PDF) was born.
Developed by Adobe in June 1993, PDF does an excellent job at presenting documents with text formatting and images in a manner independent of operating systems. But, did you know that PDF has one of the most sophisticated specifications for a file format?
Take a quick look at the open specification document for PDF 1.7. On page 115, Adobe describes the coordinate system and mechanism used to position an image or a font in the document, along with leveraging transform, rotation and scaling matrices to manipulate these objects. This is just one example of how sophisticated PDF can be.
Understanding the 750 pages worth of jargon and complexity of what makes up a PDF is not for the faint of heart. You may even need an understanding of linear algebra that is beyond anything rudimentary to fully grasp this concept. This complexity is unsurprising considering that PDFs today have to handle rich media such as video content, vector graphics, three dimensional objects via U3D, encryption and digital signatures. However, it’s not exactly surprising why common reporting engines such as SSRS (SQL Server Reporting Services) and Crystal Reports sometimes does a poor job at rendering PDF content.
If you’ve ever wondered why common reporting engines such as SSRS (SQL Server Reporting Services) and Crystal Reports sometimes perform poorly at rendering PDF content, then this is why.
KL&A is currently developing a web-based Licensing Portal System (LPS) for a governmental client to handle their licensing needs. Part of what LPS needs to satisfy is to be able to convert Microsoft Word (.docx) documents into PDF format. We assessed three possible approaches:
1. Launch a Microsoft Word, OpenOffice, LibreOffice or something similar as an independent process (called Interop in .NET land) and have it convert the document to PDF. This would’ve been the easiest and most accurate way to perform the conversion, but the concerns with scalability, licensing (Microsoft frowns upon this practice) and fragility (any updates to the Word software could break this) quickly ruled this option out.
2. Have a cloud service convert the word document into PDF. Since LPS is being deployed on the State’s hardware, there were security concerns over sending the file outside of the State’s network, so this was not an option either.
3. Leverage a .NET library to programmatically convert the Word document’s OpenXML language into PDF’s Postscript language. Unsurprisingly, this was our only option.
Out of the 18 different libraries we evaluated, we chose Aspose’s Aspose.Words for our file conversion needs. During our evaluations, Aspose.Words was one of only two libraries that successfully converted Word documents into PDFs. The other 16 libraries we tried either failed to retain the formatting correctly, or crashed while attempting to convert the document.
As you can see from the images below, Aspose.Words works great. It allows the users to simply click the “download” link and have a PDF generated without any issues.
Between the two libraries that worked, we went with Aspose.Words because Aspose.Words provides far more flexible licensing options, such as a perpetual license. Whereas, a perpetual licensing was not an option with the other products. Also, Aspose.Words provides fantastic documentation and samples to get up to speed with the technology.
So, why should you consider Aspose.Words? Well, if a tremendously difficult document conversion can be done by a few lines of code, then it’s hard to argue why you shouldn’t.
Other recent posts:
How Leadership Skills From Martial Arts Can Apply to Your Job
Blog Barista: Casey Herman | August 21, 2019 | Career Hacks | Brew time: 6 min
I expected to learn self-defense, how to perform specific strikes, discipline, and respect through Taekwondo, but as someone that had studied leadership theory as both an undergrad and graduate student, I did not expect to learn about leadership as much as I have from Taekwondo…
Developers Should Never Compromise Quality Code Ever
Blog Barista: Ian DesJardins | August 8, 2019 | Development Practices | Brew time: 4 min
Fast deadlines, desperate clients, project hangups, and personal shortcomings. As developers who put every ounce of their craft into their code, we must submit to all setbacks that make their way onto our “perfectly” paved path and navigate them with grace. Truth be told, it’s a…