Developer Tools
|
Office Productivity Applications
|
Platform-Agnostic APIs
|
Home | Online Demos | Downloads | Buy Now | Support | About Us | News | Working Together | Contact Us
I am new to JSP but decided to give this a try anyway. First, I had to install the Apache Tomcat Server.
JAVA_HOME
for the JDK installation folder.C:\
drive. Installation over.CATALINA_HOME
with the path to the Tomcat folder.
bin\startup.bat
file using this account. (I am still on XP and my regular account is a full-blown Admnistrator account.)
Next, I had to create a JSP script that used PDFOne to create a new PDF document and send it down to the browser.
lib
in the C:\apache-tomcat-7.0.14\webapps\ROOT\WEB-INF
for the PDFOne JAR files.C:\apache-tomcat-7.0.14\webapps\ROOT\test.jsp
with the following content.
<%@page import="com.gnostice.pdfone.PDFOne" %> <%@page import="com.gnostice.pdfone.PdfDocument" %> <%@page import="com.gnostice.pdfone.fonts.PdfFont" %> <%@page import="java.awt.Color" %> <% // Activate your license PDFOne.activate("your-pdfone-activation-key", "your-pdfone-product-key"); try { // Create a new PDF document PdfDocument doc = new PdfDocument(); // Access the default font and modify it PdfFont defaultFont = doc.getFont(); defaultFont.setStyle(PdfFont.STROKE_AND_FILL); defaultFont.setSize(60); defaultFont.setStrokeColor(Color.RED); defaultFont.setStrokeWidth(2); defaultFont.setColor(Color.YELLOW); // Prepare the browser response.setContentType("application/pdf"); response.setBufferSize(2000); // Set PDF version to 1.4 for backward compatibility doc.setVersion(PdfDocument.VERSION_1_4); // Render text on the first page doc.writeText("Hello, World!", 100, 100); // Save the document to the browser doc.save(response.getOutputStream()); // Close the document doc.close(); // Close the browser output response.flushBuffer(); } catch (Exception e) { out.println("Sorry, an error occurred " + e.getMessage() ); } %>
---o0O0o---
Our .NET Developer Tools | |
---|---|
![]() Gnostice Document Studio .NETMulti-format document-processing component suite for .NET developers. |
![]() PDFOne .NETA .NET PDF component suite to create, edit, view, print, reorganize, encrypt, annotate, and bookmark PDF documents in .NET applications. |
Our Delphi/C++Builder developer tools | |
---|---|
![]() Gnostice Document Studio DelphiMulti-format document-processing component suite for Delphi/C++Builder developers, covering both VCL and FireMonkey platforms. |
![]() eDocEngine VCLA Delphi/C++Builder component suite for creating documents in over 20 formats and also export reports from popular Delphi reporting tools. |
![]() PDFtoolkit VCLA Delphi/C++Builder component suite to edit, enhance, view, print, merge, split, encrypt, annotate, and bookmark PDF documents. |
Our Java developer tools | |
---|---|
![]() Gnostice Document Studio JavaMulti-format document-processing component suite for Java developers. |
![]() PDFOne (for Java)A Java PDF component suite to create, edit, view, print, reorganize, encrypt, annotate, bookmark PDF documents in Java applications. |
Our Platform-Agnostic Cloud and On-Premises APIs | |
---|---|
![]() StarDocsCloud-hosted and On-Premises REST-based document-processing and document-viewing APIs |
Privacy | Legal | Feedback | Newsletter | Blog | Resellers | © 2002-2023 Gnostice Information Technologies Private Limited. All rights reserved. |