Skip to main content

Posts

Showing posts from June, 2019

Add Text Watermark and Image Watermark to PDF in Java

In this blog, I’ll introduce how to add text watermark and image watermark to a PDF file using Free Spire.PDF for Java library. Before using the below code, you need to download Free Spire.PDF for Java from this link and import the jar file under the lib folder to your project. Add text watermark import com.spire.pdf.*; import com.spire.pdf.graphics.*; import java.awt.*; import java.awt.geom.*; public class Watermark {     public static void main(String[] args){         // load PDF file         PdfDocument pdf = new PdfDocument();         pdf.loadFromFile( "Software - Wikipedia.pdf" );         //add text watermark to every page in the PDF file         for ( int i = 0 ; i< pdf.getPages().getCount(); i++) {             PdfPageBase page = pdf.getPages().get(i);             Dimension2D dimension2D = new Dimension();             dimension2D.setSize(page.getCanvas().getClientSize().getWidth() / 2 , page.getCanvas().getClientSize().getHeight() / 3 );    

Convert Word Document to Other File Formats (Pdf, Image, Html, Txt etc.) in Java

Convert Word document to other file formats is undoubtedly one of the most common requirements when we working with Word document. In this article, we’ll learn how to convert Word document to other file formats programmatically in Java by using Free Spire.Doc for Java library. Free Spire.Doc for Java library let us convert Word document to a series of file formats easily and effectively without having Microsoft Office to be installed on our system. The following conversions are supported by Free Spire.Doc for Java: Microsoft Word file format conversions Convert Word to Pdf Convert Word to Image Convert Word to Html Convert Word to Rtf Convert Word to Svg Convert Word to Txt Convert Word to Xps Convert Word to Pcl Convert Word to Post Script Convert Word to Odt Convert Word to Epub Convert Word to WordML/WordXML In the following examples, we’ll see how to convert Word document to Pdf, Image, Html and Svg. Convert Word to Pdf The following example demo