1. Trang chủ
  2. » Công Nghệ Thông Tin

Java programmers guide

368 2,5K 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 368
Dung lượng 2,07 MB

Nội dung

Ibex PDF Creator Java Programmers Guide For Ibex version 4.7.7.6 [...]... to log errors to the file ibex.log, you would do this: java ibex.Run -xml hello.fo -pdf hello.pdf -logfile ibex.log Using Ibex 29 Ibex PDF Creator Developers Guide 5.1.3 Listing available fonts You can also list the fonts which are available (based on what fonts are configured in your ibexconfig.xml file) by using the -fonts option like this: java ibex.Run -fonts The list of fonts is produced as a... 5-1 Figure 5-1: java -classpath d:\saxon-6.5.5\saxon.jar;ibex-4.1.8.jar Using Saxon 6.5.5 -Djavax.xml.transform.TransformerFactory=com.icl.saxon.TransformerFactoryImpl ibex.Run -xml test.xml -xsl test.xsl -pdf test.pdf 5.2.6.2 Using Ibex with Saxon 8 To use Ibex with Saxon 8.9 place Saxon on the classpath and specify the TransformerFactory property as shown in Figure 5-2 Figure 5-2: java -classpath... command line program which can be used to create PDF files from FO files Ibex ships with a Java class called ibex.Run which can be used to create PDF files from the command line To create a PDF file from an FO file specify the file names on the command line For instance to create hello.pdf from hello.fo, you do this: java ibex.Run -xml hello.fo -pdf hello.pdf 5.1.1 XSLT translation The command line program... and the results then formatted to PDF The command line syntax is: java ibex.Run -xml book.xml -xsl bool.xsl -pdf hello.pdf XSLT parameters can be passed to the stylesheet by adding them as name-value pairs to the command line For instance, if we want to define the parameter called "age" to the value "30" we use a command like this: java ibex.Run -xml book.xml -xsl bool.xsl -pdf hello.pdf "age=30" The... file specify the names of the FO and PDF files on the command line For example to create hello.pdf from hello.fo you do this: java ibex.Run -xml hello.fo -pdf hello.pdf If the names of the input and output files are the same (ignoring the extensions) you can abbreviate this to: java ibex.Run -xml hello.fo 3.2 Error logging Any informational or error messages will be logged to the console To send any... void generate( InputStream foStream, OutputStream pdfstream, boolean closeStream ) public void generate( InputStream foStream, 30 Using Ibex Ibex PDF Creator Developers Guide OutputStream pdfstream ) This will read the FO from the java. io.InputStream called foStream and create the PDF file into the stream 'pdfstream' If closeStream is true the stream will be closed after the PDF file is generated,... pdf, boolean closeStream ) Ibex uses the Java runtime XSLT processor to transform the XML using the specified stylesheet and passes the resulting FO to the PDF creation routines The transformation is done to a temporary file which is deleted at the end of the transformation process This is done to reduce memory usage when processing massive XML files 5.2.4 Example Java Program This code will create a PDF... ibex.log the command becomes: java ibex.Run -logfile ibex.log -xml hello.fo -pdf hello.pdf 3.3 An example without XSLT translation The Ibex command line program will create a PDF file from either (a) an FO file or (b) an XML file with an XSLT stylesheet This section shows how to create a PDF file from an FO file Getting Started with Ibex 7 Ibex PDF Creator Developers Guide This example uses the FO... TransformerFactory property as shown in Figure 5-2 Figure 5-2: java -classpath d:\saxon-8.9\saxon8.jar;ibex-4.1.8.jar Using Saxon 8 -Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl ibex.Run -xml test.xml -xsl test.xsl -pdf test.pdf Note that the settings for the javax.xml.transform.TransformerFactory property are different for different version of Saxon Using Saxon 8 provides support... list, block and table which define the content to appear on the page In this example we have a single block element containing the text "Hello World" Introduction to XSL-FO 13 Ibex PDF Creator Developers Guide This produces a page like the one shown in Figure 4-8 The region created by the region-body element has a shaded background so you can see how large it is Figure 4-8: A basic page with a region-body . Ibex PDF Creator Java Programmers Guide For Ibex version 4.7.7.6

Ngày đăng: 21/10/2014, 23:58

TỪ KHÓA LIÊN QUAN