Works for me, generated with 0.93b, tested with Acrobat 5.05. Please send me
your generated pdf.
Best Regards,
Paulo Soares
----- Original Message -----
From: "Utilisateur1" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 03, 2002 16:06
Subject: [iText-questions] Bookmarks problem with Acrobat 5.0
> I have a problem with the bookmarks with Acrobat 5.0 (windows).
> When i choose some bookmarks, i see the next page.
>
> With Acrobat 4.0, no problem.
> Alain.
>
>
> Example : chapitre 1 and 2 = KO, chapitre 3 = OK
>
>
> import com.lowagie.text.*;
> import com.lowagie.text.pdf.*;
> import java.io.*;
>
> public class bookmark {
>
> static int page = 0;
>
> public static void main(String[] args) {
>
> Document document = new Document(PageSize.A4);
>
> try {
>
> PdfWriter writer = PdfWriter.getInstance(document,
> new
> FileOutputStream(
>
> "c:/bookmark.pdf"));
> document.open();
>
> Font fonttitre = new Font(Font.TIMES_NEW_ROMAN, 30);
> Phrase titre = new Phrase("\n\n\n\n ESSAI \n\n",
> fonttitre);
> Paragraph ptitre = new Paragraph(titre);
> ptitre.setAlignment(Element.ALIGN_CENTER);
> document.add(ptitre);
> document.setPageSize(PageSize.A4.rotate());
> document.newPage();
> loadDocument(document);
>
> } catch (Exception e2) {
> System.out.println(e2);
> }
>
> document.close();
> }
>
> public static void loadDocument(Document document) {
>
> String[] bogusData = {
> "ADDADA", "10", "EEEEE", "SSSSS", "NULL", "3", "1", "RFRF",
> "10",
> "1", "TTTTT", "OOOO"
> };
> int NumColumns = 12;
>
> try {
>
> PdfPTable datatable = new PdfPTable(NumColumns);
> datatable.getDefaultCell().setPadding(3);
>
> int[] headerwidths = {
> 15, 8, 10, 8, 10, 10, 10, 10, 10, 10, 19, 10
> }; // percentage
> datatable.setWidths(headerwidths);
> datatable.setWidthPercentage(100); // percentage
> datatable.getDefaultCell().setBorderWidth(2);
> datatable.getDefaultCell().setHorizontalAlignment(
> Element.ALIGN_CENTER);
>
> String[] sentete = {
> "AAA", "BBB", "CCCC", "DDDD", "EEEE", "FFFF", "GGGG",
> "HHHHH",
> "IIIII", "JJJJ", "KKKKK", "LLLLLL"
> };
>
> for (int i = 0; i < sentete.length; i++) {
> datatable.addCell(new Phrase(sentete[i],
> new
> Font(Font.TIMES_NEW_ROMAN, 10)));
> }
>
> datatable.setHeaderRows(1); // this is the end of the table
> header
> datatable.getDefaultCell().setBorderWidth(1);
> page++;
>
> int max = 100;
>
> for (int i = 1; i < max; i++) {
>
> if (i % 2 == 1) {
> datatable.getDefaultCell().setGrayFill(0.9f);
> }
>
> for (int x = 0; x < NumColumns; x++) {
> datatable.addCell(new Phrase(bogusData[x],
> new
> Font(Font.TIMES_NEW_ROMAN,
> 10)));
> }
>
> if (i % 2 == 1) {
> datatable.getDefaultCell().setGrayFill(0.0f);
> }
> }
>
> Font fonttitre2 = new Font(Font.TIMES_NEW_ROMAN, 15,
> Font.BOLD);
> Phrase nomchapitre = new Phrase("CHAPITRE 1", fonttitre2);
> Paragraph parchap = new Paragraph(nomchapitre);
> Chapter chapter = new Chapter(parchap, 1);
> Font fontsection2 = new Font(Font.HELVETICA, 14,
> Font.UNDERLINE);
> Phrase nomsection = new Phrase("sous chapitre 1",
> fontsection2);
> Paragraph parsect = new Paragraph(nomsection);
> Section section = chapter.addSection(parsect, 2);
> Paragraph para1 = new Paragraph("blbbla");
> para1.setAlignment(Element.ALIGN_CENTER);
> section.add(para1);
> section.add(datatable);
> document.add(chapter);
> nomchapitre = new Phrase("CHAPITRE 2", fonttitre2);
> parchap = new Paragraph(nomchapitre);
> chapter = new Chapter(parchap, 2);
> nomsection = new Phrase("sous chapitre 1", fontsection2);
> parsect = new Paragraph(nomsection);
> section = chapter.addSection(parsect, 2);
> section.add(new Paragraph("blabla"));
> section.add(datatable);
> document.add(chapter);
>
> document.newPage();
> document.setPageSize(PageSize.A4);
>
> nomsection = new Phrase("sous chapitre 2", fontsection2);
> parsect = new Paragraph(nomsection);
> section = chapter.addSection(parsect, 2);
> section.add(new Paragraph("blabla"));
> document.add(section);
> document.newPage();
> nomchapitre = new Phrase("CHAPITRE 3", fonttitre2);
> parchap = new Paragraph(nomchapitre);
> chapter = new Chapter(parchap, 3);
> nomsection = new Phrase("sous chapitre 1", fontsection2);
> parsect = new Paragraph(nomsection);
> section = chapter.addSection(parsect, 2);
> section.add(new Paragraph("blabla"));
> document.add(chapter);
>
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> }
> ------------------------------------------------------------------------
> -------------------------------------- END
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions