Closed codecounselor closed 8 years ago
This sound exciting! Thanks for the great work @codecounselor .
As for exporting .ppt
and .pptx
, this sounds a very special use case for me.
Do you think we can make this functionality a separate module, that works similar to what electron-pdf, that only does pdf2ppt or pdf2pptx.
And say if a user ever want to convert a markdown file to ppt, we use electron-pdf
to convert it to a pdf
first, and then user the pdf2ppt
module to take over the work. This could be done either:
pdf2ppt
inside electron-pdf
, and we use it by make it a dependency of electron-pdf
pdf2ppt
module. We can discuss what tool we use for pdf2ppt
later but I'd like to address how we approach to this problem first, what do you think?
I got this working today, I will probably push that later tonight. Separating it sounds good on paper for sure. But my use case is such that I may have a lot (> 100) of multi-page PDFs to turn into images and stick in a powerpoint. Being able to multi-thread that in a single process is why I'd like to leave it here for now. I'll follow up with more details in a later post, but maybe we could have some ENV settings to disable certain features if people don't want them.
As for the tools, I'm using pdf2images-multiple
to split the PDF into images. Turns out pdf.js isn't really meant for that purpose.
Come to think of it, maybe if we just emit events when files are ready the powerpoint and pdf splitting could be somewhere else. I will try that
runExport
now fires pdf-complete
after each PDF is available on the filesystem with an object containing the property file
pointing to the PDF on the local filesystem
I have created https://github.com/SpiderStrategies/pdf-powerpoint in order to perform the PDF->PPTX conversion
Requirements
When the output file has a
.ppt
or.pptx
extensionRisks
Options for PDF to PNG conversion
apt-get install -y imagemagick ghostscript poppler-utils GraphicsMagick