Five Things You Can Do With the DocumentAlchemy API
There are a lot of nifty things you can do using the DocumentAlchemy API. In this post we list five of them, and provide full source code examples on how to do each.
Beginning with Office 2007, Microsoft changed the format for Word documents from the proprietary
.doc binary format to a standards-based
.docx XML format.
Since DocumentAlchemy understands both the
.docx formats, you can use the API to “upgrade” files from the old (binary) format to the new (zipped-XML) format.
See Upgrade your *.doc files to *.docx for more detail and example code.
Technically that's three things, but we'll group them as one.
DocumentAlchemy can render Markdown as HTML, PDF and Microsoft Word files.
We'll show you a simple Bash script that can transform a Markdown document into any of those formats.
See Render Markdown as HTML, PDF or Word for more detail and shell-scripts you can use for the task.
Suppose you have a collection of images you'd like to display in a gallery. You want an "index" page with a thumbnail for each image.
But the images are of different sizes and aspect ratios.
To keep the index page looking orderly, we will scale each image to a specified width, allowing the height of each image to vary “naturally”, according to the original image's aspect ratio.
See Resize images to a fixed width for more detail and example code.
Let's assume your company is creating a “media asset” library as part of a new content management initiative.
You have a bunch of PowerPoint presentations that employees have created over the past decade, and many of them have interesting charts, photos and diagrams that you'd like to break out as individual “assets” for the library.
How do you get at all of those images without opening each deck and copying each out manually? DocumentAlchemy can help.
See Extract images from a PowerPoint deck for learn how (with sample code).
Given a collection of PDF files, you'd like to add a one-page “cover” to each document. Your cover page is also a PDF file, so your objective is to insert a single page at the beginning of each of the source documents.
We can use DocumentAlchemy's “join documents” REST endpoint to insert that cover page.