8000 GitHub - yeokm1/docs-to-pdf-converter at v1.0
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Jul 14, 2023. It is now read-only.

A standalone Java library/command line tool that converts DOC, DOCX, PPT, PPTX and ODT documents to PDF files.

License

Notifications You must be signed in to change notification settings

yeokm1/docs-to-pdf-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Docs to PDF Converter

A standalone Java command line tool that converts DOC, DOCX, PPT and PPTX documents to pdf files. (Requires JRE 7.)

Why?
I wanted a simple program that can convert Microsoft Office documents to PDF but without dependencies like LibreOffice or expensive proprietary solutions. Seeing as how code to convert each individual format is scattered around the web, I decided to combine all those solutions into one single program.

Usage:

java -jar doc-converter.jar -type "type" -inputPath "path" -outputPath "path" -verbose
eg.
java -jar doc-converter.jar -inputPath test.doc
java -jar doc-converter.jar -i test.ppt -o ~\output.pdf
java -jar doc-converter.jar -i ~\no-extension-file -o ~\output.pdf -t docx

Parameters:
-inputPath (-i, -in, -input) "path" : specifies a path for the input file

-outputPath (-o, -out, -output) "path" : specifies a path for the output PDF, use input file directory and name.pdf if not specified (Optional)

-type (-t) [doc | docx | ppt | pptx] : Specifies doc converter. Leave blank to let program infer by input extension (Optional)

-verbose (-v) : To view intermediate processing messages. (Optional)

Caveats:
This tool relies on Apache POI and docx4j libraries. They are not 100% reliable and the output format may not always be what you desire.

DOC and DOCX:
Generally ok. I notice that after conversion, the paragraph spacing tends to increase affecting your page layout.

PPT and PPTX
Resulting file is a PDF comprising of PNG images in each page. This is the limitation of the Apache POI and docx4j libraries.

Main Libraries
Apache POI: https://poi.apache.org/
docx4j: http://www.docx4java.org/
and others...

The MIT License (MIT)
Copyright (c) 2013-2014 Yeo Kheng Meng

About

A standalone Java library/command line tool that converts DOC, DOCX, PPT, PPTX and ODT documents to PDF files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages

0