Sophie

Sophie

distrib > Mandriva > 2008.1 > i586 > by-pkgid > 927a1532fb070c51449654bb68b5bde2 > files > 411

itext-manual-2.0.8-0.0.2mdv2008.1.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>iText Tutorial: New functionality in iText 2</title><meta name="Description" content="Lists what is different in iText 2."><meta name="Keywords" content="PDF, JAVA, iText, examples, Lowagie, Bruno"><link rel="stylesheet" href="./../style.css" type="text/css"></head><body><a name="top" class="logo" href="http://www.lowagie.com/iText"><img src="http://www.lowagie.com/iText/images/logo.gif" border="0" alt="iText"></a><h1>Tutorial: iText by Example</h1><h2>New functionality in iText 2</h2><div id="content"><div id="sidebar"><a class="toc" href="./../index.html#itext2">
							Table of Contents
						</a><div align="Center" class="small">Best viewed with:<br><script type="text/javascript"><!--
google_ad_client = "pub-0340380473790570";
google_ad_width = 180;
google_ad_height = 60;
google_ad_format = "180x60_as_rimg";
google_cpa_choice = "CAAQyaj8zwEaCIwcWMzeycafKMu293M";
//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div><div class="sidetitle">Sections:</div><ul><li><a href="#inaction">In the book</a></li><li><a href="#upgrade">Upgrade problems</a></li><li><a href="#functionality">New Functionality</a></li><li><a href="#bigfixes">Bugfixes / ameliorations / simplifications</a></li></ul><br><br><div class="sidetitle">Examples:</div><div class="example"><div class="small">ANT script (all examples):</div><ul><li><a href="./../itext2/build.xml">
					build.xml
				</a></li></ul></div></div><div id="main"><font color="#FF0000" size="+2">UNDER CONSTRUCTION</font><a name="inaction"></a><div class="title">In the book:</div><div xmlns="http://www.w3.org/1999/xhtml" xmlns:site="http://www.lowagie.com/iText/site">
The examples in the other chapters of this free online tutorial will help you getting started
with iText. Note that most examples are two years old. Some of the examples may be obsolete.
Also the theory that comes with the examples isn't always 100% accurate.<br>
If you want more recent examples or if you want to know more about the theoretical background of
PDF and iText, please consult the book	<a href="http://itext.ugent.be/itext-in-action/">"iText in Action"</a>.
Note that the first and the third chapter of the book can be downloaded for free from
<a href="http://www.manning.com/affiliate/idevaffiliate.php?id=223_53">http://manning.com/lowagie/</a><br>
The book discusses most of the functionality that is available in iText 1.4.8, but all the source code that
is printed in the book STILL WORKS in iText 2. Only a few changes were needed to make all the examples available
on <a href="http://itext.ugent.be/itext-in-action/chapter.php">itext.ugent.be</a> (the support site for the book)
were necessary. This iText 2 specific chapter in the free online tutorial will contain new examples that explain
how to use the newly added functionality soon.
		</div><a class="top" href="#top">Go to top of the page</a><a xmlns="" name="upgrade"></a><div class="title">Upgrade problems:</div><div xmlns="http://www.w3.org/1999/xhtml">
iText 2 is a major release of iText. We have done a lot of
efforts to make upgrading from iText 1.x.y to iText 2.0.0
as smooth as possible, but you must understand that some
problems are unavoidable. These are the problems you can expect:
<div class="subtitle">Some classes have been moved</div>
<ul>
<li>SimpleXMLParser and related classes were moved to com.lowagie.text.xml.simpleparser.
Some lists that were inside SimpleXMLParser (entities and IANA encodings) were moved to separate classes outside HTMLWorker</li>
<li>com.lowagie.text.Entities moved to com/lowagie/text/xml/simpleparser/EntitiesToSymbol</li>
<li>com.lowagie.text.markup.MarkupTags moved to com.lowagie.text.html.Markup</li>
<li>com.lowagie.text.markup.WebColors moved to com.lowagie.text.html.WebColors</li>
</ul>
<div class="subtitle">Some classes have been removed</div>
<ul>
<li>interface MarkupAttributes: this interface could only be used to add markup attributes to HTML output.
This was completely refactored. If you want to add attributes to an HTML file, you should now use MarkedObject
and/or MarkedSection. These new classes will probably also serve for enhanced tagged PDF support in the future.
Removal of this interface affects almost all basic building blocks.
You will have to recompile your code if you decide to upgrade to iText 2.</li>
<li>class XmlWriter: the output of this class, and everything you could do with this output, didn't meet our standards.
The code is still available in CVS if you really, really need it.</li>
<li>class Graphic: if you were still using it: use direct content and/or PdfTemplate instead.
TODO: the &lt;hr&gt; tag doesn't work anymore in the XML parser.</li>
<li>class Watermark: if you were still using it: use page events instead.</li>
<li>class MarkupParser: some methods were kept in another class, but the MarkupParser itself was
never finished, and is now being abandonned.</li>
</ul>
<div class="subtitle">Methods were (re)moved</div>
<ul>
<li>Method clearTextWrap was moved from DocListener to PdfWriter/PdfDocument.
I'm not sure what the method does, but it was PDF only, so it didn't have to be in DocListener.</li>
<li>Except for the ElementListener inferface (a super-interface for DocListener),
no method in DocListener throws a DocumentException anymore. This was a result
of a suggestion made by Andrew Binstock concerning the newPage() method.</li>
<li>RomanList: methods to get an uppercase/lowercase roman number were renamed
(uniform use of caps)</li>
<li>PdfLine: the method getMaxSize wasn't used anyhere; it may be a remains of the Erwin Acherman code
(July 2002.0). I removed it, and introduced a method addToLine that probably does more or less
the same.</li>
</ul>
<div class="subtitle">Extra jars are necessary</div>
All the classes in package com.lowagie.bc were removed.
You now need the following BouncyCastle jars in your CLASSPATH
if you want support for encryption:
<ul>
<li><a target="blank" href="http://prdownloads.sourceforge.net/itext/bcmail-jdk14-135.jar">bcmail-jdk14-135.jar</a></li>
<li><a target="blank" href="http://prdownloads.sourceforge.net/itext/bcprov-jdk14-135.jar">bcprov-jdk14-135.jar</a></li>
</ul>
Note that you can download other versions of these jars for other JDKs from <a href="http://bouncycastle.org/">BouncyCastle.org</a>.
<div class="subtitle">iText version / JDK version</div>
This version of iText is compiled for use with JDK 1.4.
It will also work for Java 5 and Java 6.
However, if you need iText to work with earlier versions of the JDK,
you should read <a href="http://itext.ugent.be/library/question.php?id=19">this FAQ entry</a>.
</div><a class="top" href="#top">Go to top of the page</a><a xmlns="" name="functionality"></a><div class="title">New Functionality:</div><div xmlns="http://www.w3.org/1999/xhtml">
A lot of new functionality has been added. Examples on how to use
this new functionality will be available in this tutorial soon.
<div class="subtitle">PDF specific functionality</div>
<ul>
<li>Added full support for portable collections (PDF 1.7)</li>
<li>PDF 1.7 brought new preferences concerning printing (Duplex, Simplex, number of copies,...).
All these new preferences are now implemented, including some other (1.6) preferences
that were overlooked in previous iText versions. The constants defining the preferences have
changed, and there's a new method to set key/value preferences (instead of setting the
preferences bitwise). Because of these changes, you will have to recompile your own source
code if you want to upgrade to iText 2.</li>
<li>Added support for GoToE actions (PDF 1.6)</li>
<li>It is now also possible to change the version <i>after</i> the header
was written. In this case the version number is added to the catalog dictionary.</li>
<li>Added a new static method in PdfPageLabels that gives you a String array with all the page labels
of an existing PDF file.</li>
<li>Added a method to set the NeedAppearances entry form an AcroForm</li>
<li>Extra method to add the name (NM) of an annotation</li>
</ul>
<div class="subtitle">iText specific functionality</div>
<ul>
<li>New class PdfSmartCopy by Michael Neuweiler and Bruno;
improved by Paulo. It needs more CPU and memory than PdfCopy,
but generally produces files with a reduced file size (compared to the
file size after concatening PDFs with PdfCopy).</li>
<li>PdfTemplate and PdfAppearance can now be statically created.
This also fixes some problems when using PdfStamper where getDirectContent()
is not allowed.</li>
<li>Lists no longer need a symbol indent. iText can calculate the
indentation automatically; with the option of each item having its own
indentation, or all items having the same (maximum) indentation.</li>
<li>Lettered lists and greek lists can now have more than 26 or 24 items.
z is followed by aa, ab, ac,... zz is followed by aaa, aab, aac,...</li>
<li>ChapterAutoNumber used a static value to keep the chapter number, this wasn't a good idea; I changed this.</li>
<li>Added support for Paragraph.setFirstLineIndent in document.add(Paragraph p); formerly this was only supported in combination with ColumnText.</li>
<li>Toolbox: Carsten Hammer added some functionality to sort the Versions</li>
</ul>
<div class="subtitle">Encryption</div>
<ul>
<li>Some old methods to set the encryption were deprecated.
The preferred method is in a new interface.</li>
<li>Support for Certificate encryption was added.</li>
<li>iText now requires two extra jars in the CLASSPATH whenever encryption is involved:
namely the bcmail and bcprov jar from BouncyCastle.</li>
</ul>
<div class="subtitle">Digital Signatures</div>
<ul>
<li>More certification options were added (certifying signatures)</li>
</ul>
<div class="subtitle">For your convenience</div>
<ul>
<li>Another hack to read broken PDF files with strange version numbers in the header.</li>
<li>Another fix to read broken tiffs</li>
</ul>
<div class="subtitle">iText and jBoss/SEAM</div>
<ul>
<li>A helper method for jBoss SEAM :convert a String with entities to a normal string (with unicode characters)</li>
<li>ElementTags: You can now convert an alignment String to an alignment value</li>
<li>PageSize: there's a method in the toolbox that translates a String to a Rectangle,
but I rewrote a method by Norman Richards that has more potential. My method could only
translate Strings like "A4" and "LETTER" to a corresponding Rectangle; with Norman's method
you can also use Strings like "400 600". I adapted the method so that "166.66 333.33" are
also allowed.</li>
</ul>
</div><a class="top" href="#top">Go to top of the page</a><a xmlns="" name="bigfixes"></a><div class="title">Bugfixes / ameliorations / simplifications:</div><div xmlns="http://www.w3.org/1999/xhtml">
<ul>
<li>PdfDocument/PdfWriter/DocListener have changed internally: the order of the methods was altered,
and extra comments to the source code were added, so that we now have a better view on what every method does.
The readibility of the code has improved.
This is a work in progress. More changes will follow in iText 2.0.1.</li>
<li>I made different new interfaces that make it more clear how to set encryption, viewer preferences, PDF/X Conformance,...</li>
<li>When the PDF version is set automatically to a value that is higher than the default
(for instance because new functionality was used), we now check if the current version
isn 't higher already.</li>
<li>Toolbox: Carsten added more JavaDoc info to the Watermarker plug-in</li>
<li>Simplification in PdfPRow</li>
<li>Entities: Integer values were changed to Character values (because that makes more sense)</li>
<li>PdfGraphics2D: null handling for hints</li>
<li>RtfWriter and RtfWriter2: avoid calling flush() after closing the stream</li>
<li>problem with nonbreakingspace
there aren 't any metrics for nbsp in the AFM files.</li>
<li>Bugfix: lest strict object type was needed during signature verifying</li>
<li>Bugfix: form flatten failed with an empty appearance dictionary</li>
<li>Bugfix: class FontSelector: newline bug was fixed</li>
<li>Bugfix: class MappedRandomAccessFile: finalize() would try to close a null channel</li>
<li>Bugfix: if a field in an AcroForm is required, its value should not be set;
otherwise the form can be submitted without entering a value (the empty string
that was set by iText is sent to the server).</li>
<li>Solved a problem when adding WMF or PS with PdfStamper</li>
<li>Bugfix: PdfPTables wrapped in a Paragraph were still causing troubles with newlines and alignments</li>
<li>Bugfix: class Barcode: inkspreading was not set</li>
<li>Toolbox: bugfix by Carsten Hammer: the value for the srcfile (corresponding with a key containing the filename) was wrong</li>
</ul>
</div><a class="top" href="#top">Go to top of the page</a><div id="footer">
			Page Updated: 2007/02/20 12:38:53
			Copyright &copy; 1999-2005
			Bruno Lowagie<br><a href="http://www.lowagie.com/iText/">iText</a> is a Free Java-Pdf library by Bruno Lowagie and Paulo Soares.
		</div></div></div><div class="commercial"><br><script type="text/javascript"><!--
google_ad_client = "pub-0340380473790570";
google_ad_width = 120;
google_ad_height = 600;
google_ad_format = "120x600_as";
google_ad_channel ="";
google_ad_type = "text_image";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "1B09BD";
google_color_url = "100670";
google_color_text = "707070";
//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script><br><br><div class="subtitle">Amazon books:</div><script type="text/javascript"><!--
document.write('<iframe src="http://rcm.amazon.com/e/cm?t=itisacatalofwebp&o=1&p=8&l=as1&asins=1932394796&fc1=000000&lc1=0000ff&bc1=&lt1=_blank&IS2=1&bg1=ffffff&f=ifr" width="120" height="240" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" align="Center"></iframe>');
//--></script><a xmlns="" href="http://www.amazon.co.uk/exec/obidos/ASIN/1932394796/catloogjecom-21" class="amazonlinks">
			amazon.co.uk-link
		</a><br><br><script type="text/javascript"><!--
document.write('<iframe src="http://rcm.amazon.com/e/cm?t=itisacatalofwebp&o=1&p=8&l=as1&asins=0321304748&fc1=000000&lc1=0000ff&bc1=&lt1=_blank&IS2=1&bg1=ffffff&f=ifr" width="120" height="240" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" align="Center"></iframe>');
//--></script><a href="http://www.amazon.co.uk/exec/obidos/ASIN/0321304748/catloogjecom-21" class="amazonlinks">
			amazon.co.uk-link
		</a><br><br><script type="text/javascript"><!--
document.write('<iframe src="http://rcm.amazon.com/e/cm?t=itisacatalofwebp&o=1&p=10&l=st1&mode=books&search=Fonts&=1&fc1=&lc1=&lt1=&bg1=&f=ifr" width="120" height="460" border="0" frameborder="0" style="border:none;" scrolling="no" marginwidth="0" marginheight="0"></iframe>');
//--></script><br></div></body></html>