[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[science-iwg] PDFBox Extensions
|
Hi folks,
I've written some extensions for Apache PDFBox to let one create PDFs
more easily, see attached PDF. The repo is located here:
https://git.eclipse.org/c/chemclipse/org.eclipse.chemclipse.chemclipsecore.git
Code and tests "branch develop" are located here:
org.eclipse.chemclipse.pdfbox.extensions
org.eclipse.chemclipse.pdfbox.extensions.fragment.test
Elements (text, image, line, tables, ...) can be positioned e.g. based
on a "mm" scale and a page center top left instead of bottom left:
PageUtil pageUtil = new PageUtil(document, new
PageSettings(PDRectangle.A4, PageBase.TOP_LEFT, Unit.MM, false));
pageUtil.printImage(new ImageElement(10,
10).setImage(JPEGFactory.createFromStream(document,
PageUtil_1_ITest.class.getResourceAsStream("logo.jpg"))).setWidth(63.5f).setHeight(8.05f));
pageUtil.printText(new TextElement(10, 20, 190).setText("Hello World"));
pageUtil.close();
Do we have an utils project in Eclipse where to move these "generic"
extensions to, so that code can easily be re-used by other projects?
I not necessarily want to file a new project proposals only for the
"Apache PDFBox" extensions.
Best,
Philip
--
~~~~~~~~~~~~~~~~~~~~~~~~
OpenChrom - the open source alternative for chromatography / mass spectrometry
Dr. Philip Wenig » Founder » philip.wenig@xxxxxxxxxxxxx » http://www.openchrom.net
~~~~~~~~~~~~~~~~~~~~~~~~
Attachment:
PageUtil_1_ITest.pdf
Description: Adobe PDF document