<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blog @ SIB Visions &#187; PDF</title>
	<atom:link href="http://blog.sibvisions.com/tag/pdf/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.sibvisions.com</link>
	<description>Blog @ SIB Visions</description>
	<lastBuildDate>Mon, 13 Apr 2026 09:47:01 +0000</lastBuildDate>
		<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>toPDF update</title>
		<link>https://blog.sibvisions.com/2014/11/04/topdf-update/</link>
		<comments>https://blog.sibvisions.com/2014/11/04/topdf-update/#comments</comments>
		<pubDate>Tue, 04 Nov 2014 13:10:17 +0000</pubDate>
		<dc:creator>rjahn</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PDF]]></category>

		<guid isPermaLink="false">http://blog.sibvisions.com/?p=3302</guid>
		<description><![CDATA[Some time ago, I wrote about toPDF. It's a simple web application that allows office format to PDF conversion using PDFCreator. It's open source and allows synchronuous conversion via http post requests or REST calls.
We made some changes in toPDF that makes it possible to use different converter tools/SDKs. It's now possible to use PDFCreator [...]]]></description>
			<content:encoded><![CDATA[<p>Some time ago, I wrote about <a href="http://sourceforge.net/projects/pdfcreator/">toPDF</a>. It's a simple web application that allows office format to PDF conversion using PDFCreator. It's open source and allows synchronuous conversion via http post requests or REST calls.</p>
<p>We made some changes in toPDF that makes it possible to use different converter tools/SDKs. It's now possible to use <a href="http://sourceforge.net/projects/pdfcreator/">PDFCreator</a> or <a href="http://www.pdfonline.com/easypdf/sdk/">easyPDF SDK</a>. The first solution is OpenSource and the last is commercial. I prefer the commercial SDK because it has a lot of useful features, offers a Java bridge and works super fast in server environments. The OpenSource solution also works, but needs some tinkering. </p>
<p>Anyway, the toPDF application supports both and it's easy to integrate other converter. Simply implement the interface</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;"><span class="kw1">public</span> <span class="kw1">interface</span> IPdfOperator<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">void</span> convert<span class="br0">&#40;</span><span class="kw3">File</span> pDocument, <span class="kw3">File</span> pPdf, PdfSettings pSettings<span class="br0">&#41;</span> <span class="kw1">throws</span> <span class="kw3">Exception</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></div>
</div>
<p>Set the context parameter: <em>operatorClass</em> in your web.xml, e.g.</p>
<div class="codesnip-container" >
<div class="xml codesnip" style="font-family:monospace;"><span class="sc3"><span class="re1">&lt;context-param<span class="re2">&gt;</span></span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;description<span class="re2">&gt;</span></span></span>PDF operator<span class="sc3"><span class="re1">&lt;/description<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; <span class="sc3"><span class="re1">&lt;param-name<span class="re2">&gt;</span></span></span>operatorClass<span class="sc3"><span class="re1">&lt;/param-name<span class="re2">&gt;</span></span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;param-value<span class="re2">&gt;</span></span></span>com.sibvisions.topdf.operator.pdfforge.PdfCreatorOperator<span class="sc3"><span class="re1">&lt;/param-value<span class="re2">&gt;</span></span></span><br />
<span class="sc3"><span class="re1">&lt;/context-param<span class="re2">&gt;</span></span></span></div>
</div>
<p>The default operator is <em>com.sibvisions.topdf.operator.bcl.EasyPdfOperator</em>.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sibvisions.com/2014/11/04/topdf-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New project: toPDF</title>
		<link>https://blog.sibvisions.com/2013/07/03/new-project-topdf/</link>
		<comments>https://blog.sibvisions.com/2013/07/03/new-project-topdf/#comments</comments>
		<pubDate>Wed, 03 Jul 2013 09:59:29 +0000</pubDate>
		<dc:creator>rjahn</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PDF]]></category>

		<guid isPermaLink="false">http://blog.sibvisions.com/?p=2296</guid>
		<description><![CDATA[We tried to find a simple solution to convert MS Office files to pdf, without online services. We tried OpenOffice but the results were awful! There are a lot of free, and commercial, PDF printers available. But they are for desktops and a user has to print manually. We wanted a solution that works without [...]]]></description>
			<content:encoded><![CDATA[<p>We tried to find a simple solution to convert MS Office files to pdf, without online services. We tried OpenOffice but the results were awful! There are a lot of free, and commercial, PDF printers available. But they are for desktops and a user has to print manually. We wanted a solution that works without user interaction.</p>
<p>There is a very useful open source project called <a href="https://sourceforge.net/projects/pdfcreator/">PDFCreator</a>. It also is a printer but has a useful API. The API is available via COM, which is not the best technology for Java, but it's also not bad.</p>
<p>We didn't find a ready-to-use solution for our idea and it shouldn't cost money. The solution had to be open source. We found some great commercial tools and SDKs but all of them were not cheap.</p>
<p>We spent some hours and used PDFCreator, Jacob and some other open source tools to create an "Online service for PDFCreator". The result of our work is <a href="https://sourceforge.net/projects/topdf/">toPDF</a>.</p>
<p><strong>What is toPDF?</strong></p>
<p>It's a small library that allows conversion of files to PDF, via PDFCreator. It's also a web application that offers services for remote conversion via http. The application has a REST service and a simple servlet service.</p>
<p>Simply POST binary data via http request and receive a PDF in the response. The servlet supports multipart form-data and simple application/octet-stream as requests. The REST service also supports multipart form-data but also JSON requests.</p>
<p>A short example:</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;"><span class="kw3">URL</span> url <span class="sy0">=</span> <span class="kw1">new</span> <span class="kw3">URL</span><span class="br0">&#40;</span>getServletService<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p><span class="kw3">URLConnection</span> ucon <span class="sy0">=</span> url.<span class="me1">openConnection</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> <br />
ucon.<span class="me1">setDoOutput</span><span class="br0">&#40;</span><span class="kw2">true</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
ucon.<span class="me1">setDoInput</span><span class="br0">&#40;</span><span class="kw2">true</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
ucon.<span class="me1">setUseCaches</span><span class="br0">&#40;</span><span class="kw2">false</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
ucon.<span class="me1">setRequestProperty</span><span class="br0">&#40;</span><span class="st0">&quot;Content-Type&quot;</span>, <span class="st0">&quot;application/octet-stream&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
ucon.<span class="me1">setRequestProperty</span><span class="br0">&#40;</span><span class="st0">&quot;Content-Disposition&quot;</span>, <span class="st0">&quot;attachment; filename=<span class="es0">\&quot;</span>Forms.docx<span class="es0">\&quot;</span>;&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>FileUtil.<span class="me1">copy</span><span class="br0">&#40;</span>ResourceUtil.<span class="me1">getResourceAsStream</span><span class="br0">&#40;</span><span class="st0">&quot;/com/sibvisions/topdf/Forms.docx&quot;</span><span class="br0">&#41;</span>, <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ucon.<span class="me1">getOutputStream</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p><span class="kw4">byte</span><span class="br0">&#91;</span><span class="br0">&#93;</span> byData <span class="sy0">=</span> FileUtil.<span class="me1">getContent</span><span class="br0">&#40;</span>ucon.<span class="me1">getInputStream</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
<p>or as Multipart:</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;">MultipartUtil multipart <span class="sy0">=</span> <span class="kw1">new</span> MultipartUtil<span class="br0">&#40;</span><span class="st0">&quot;UTF-8&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
multipart.<span class="me1">addDataPart</span><span class="br0">&#40;</span><span class="st0">&quot;data&quot;</span>, <span class="st0">&quot;Forms.docx&quot;</span>, <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ResourceUtil.<span class="me1">getResourceAsStream</span><span class="br0">&#40;</span><span class="st0">&quot;/com/sibvisions/topdf/Forms.docx&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p><span class="kw4">byte</span><span class="br0">&#91;</span><span class="br0">&#93;</span> byData <span class="sy0">=</span> multipart.<span class="me1">post</span><span class="br0">&#40;</span>getServletService<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
<p>The conversion via PDFCreator works great, but not perfect. There are different problems with small page margins in Word documents, problems with OpenOffice documents, ...</p>
<p>The problem is not toPDF, because it works as good as PDFCreator does. If PDFCreator doesn't convert a document, toPDF has no chance to convert it.</p>
<p>We had problems with simple image conversions to PDF because default windows print dialog appeared and we didn't associate image extensions with another tool. We solved the conversion of images with iText instead of PDFCreator. Now it's possible to create PDFs from images very easily without pop-ups.</p>
<p><strong>License?</strong></p>
<p>AGPL 3.0, because PDFCreator is licensed under GPL and iText is licensed under AGPL.</p>
<p><strong>Used tools and libraries</strong></p>
<p>toPDF is a mixture of different open source projects:</p>
<p><a href="https://sourceforge.net/projects/pdfcreator/">PDFCreator</a><br />
<a href="http://itextpdf.com/">iText</a><br />
<a href="http://restlet.org/">RESTlet</a><br />
<a href="http://jackson.codehaus.org/">Jackson</a><br />
<a href="https://sourceforge.net/projects/jvx/">JVx</a><br />
<a href="http://commons.apache.org/">Apache commons FileUpload and IO</a><br />
<a href="https://sourceforge.net/projects/jacob-project/">Jacob</a><br />
<a href="https://sourceforge.net/projects/pdfcreator4j/">PDFCreator4J</a></p>
<p><strong>Installation?</strong></p>
<ul>
<li>toPDF was written in Java, but the installation only makes sense on Windows (same requirements as PDFCreator)</li>
<li>Install PDFCreator (default desktop installation, with COM)</li>
<li>Deploy <a href="https://sourceforge.net/projects/topdf/files/1.0/">topdf.war</a> on Tomcat or JBoss or your preferred Java application server. If your application server runs as windows service, be sure that it runs as OS user.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>https://blog.sibvisions.com/2013/07/03/new-project-topdf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
