Skip to main content

Posts

Showing posts with the label PDF

Replace Text in PDF in Java

  This article introduces two ways to replace text in PDF in Java: Replace only the first occurrence of the specified text Replace all occurrences of a specified text Before using the following code, you need to download Free Spire.PDF for Java API, unzip the package and then add Spire.Pdf.jar in the lib folder into your project. If you’re creating maven projects, you can install Free Spire.PDF for Java API from maven repository .   Replace only the first occurrence of the specified text import com.spire.pdf.PdfDocument ; import com.spire.pdf.PdfPageBase ; import com.spire.pdf.general.find.PdfTextFind ; import com.spire.pdf.general.find.PdfTextFindCollection ; import com.spire.pdf.graphics.PdfBrush ; import com.spire.pdf.graphics.PdfBrushes ; import com.spire.pdf.graphics.PdfRGBColor ; import com.spire.pdf.graphics.PdfSolidBrush ; import com.spire.pdf.graphics.PdfTrueTypeFont ; import java.awt. *; import java.awt.geom.Rectangle2D ;   public class ReplaceText { ...

Search Text and Add Hyperlink on Top of the Text in PDF in Java

This article demonstrates how to search particular text in a PDF document and add link annotations on top of the text occurrences found in Java. The following example uses Free Spire.PDF for Java library. Dependencies First of all, you need to add needed dependencies for including Free Spire.PDF for Java into your Java project. There are two ways to do that. If you use maven, you need to add the following code to your project’s pom.xml file. <repositories>          <repository>              <id>com.e-iceblue</id>              <name>e-iceblue</name>              <url>http://repo.e-iceblue.com/nexus/content/groups/public/</url>          </repository>  </repositories>...

Convert Excel to Image, CSV, HTML, XPS and XML in Java

  Introduction This blog introduces how to convert Excel files by using a Free Excel API – Free Spire.XLS for Java.   Free Spire.XLS for Java is a free and independent Java API that supports converting Excel files including Excel 97-2003, Excel 2007, Excel 2010, Excel 2013 etc.) to a batch of other file formats such as PDF, Image, HTML, XPS, XML, CSV, PCL, ODS and PostScript. In the following example, I will show you how to convert Excel to Image, CSV, HTML, XPS and XML by using this API.   Add dependencies First of all, you need to add needed dependencies for including Free Spire.XLS for Java into your Java project. There are two ways to do that. If you use maven, you need to add the following code to your project’s pom.xml file.     <repositories>               <repository>                  ...