I have attached a Java class that generate à PDF file with 2 pages and the PDF generated by this class. You can see in the PDF file that the line have 2 differents size depending of the page.

1T3XT info a écrit :
Gérard KESTER wrote:
  
 It would be interesting to have a small 2-page
example that reproduces the problem to find out what happens.
Can you post such an example to the mailing list?
  
      
I  dont know how to do that. I have attached 3 files, 1 PDF files with 2 
pages and 2 PNG files.
    

Er... you are able to write a Java program that produces
a PDF like GR01.pdf, but you are not able to write some
standalone Java code we can run on our system to create
a similar PDF that reproduces the problem?

I'm sorry, but in that case, we're stuck.
  

No virus found in this incoming message. Checked by AVG. Version: 8.0.100 / Virus Database: 269.24.2/1471 - Release Date: 28/05/2008 17:33
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.geom.AffineTransform;
import java.io.FileOutputStream;
import java.io.IOException;

import javax.swing.JFrame;

import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Rectangle;
import com.lowagie.text.pdf.PdfContentByte;
import com.lowagie.text.pdf.PdfWriter;
//
public class FenEssai extends JFrame
{
        //      Numéro de série
        private static final long serialVersionUID = 1L;
        //
        //      Fichier PDF
        public Document          document;
        private Graphics2D       g2d;
        //
        //      Lignes des menus
        //
        //      
--------------------------------------------------------------------------------
        //      Constructeur
        public FenEssai()
        {
                setSize (100 , 200);
                genererPDF();
        }
        //
        //      
--------------------------------------------------------------------------------
        public void genererPDF()
        {
                document = new Document();
                PdfWriter pdfWriter;
                PdfContentByte    pdfContentByte;
                //
                try
                {
                        document.setPageSize(new Rectangle(0 , 0 , 100 ,100));
                        //
                        pdfWriter = PdfWriter.getInstance(document , new 
FileOutputStream("essai.pdf"));
                        document.open();
                        pdfContentByte = pdfWriter.getDirectContentUnder();
                        g2d = pdfContentByte.createGraphicsShapes(100, 100);
                        //      Traitement de génération PDF
                        //
                        //      On dessine un trait
                        g2d.setPaint(new Color(150,150,255));
                        g2d.setStroke(new BasicStroke(10.0f));
                        g2d.drawLine(10 , 50 , 190 , 50);
                        //      Décalage du dessin pour l'édition de la page 
suivante
                        AffineTransform transformation;
                        transformation = AffineTransform.getTranslateInstance(- 
100 , 0);
                        g2d.transform(transformation);
                        //
                        document.newPage();
                        //      On dessine un trait
                        g2d.setPaint(new Color(150,150,255));
                        g2d.setStroke(new BasicStroke(10.0f));
                        g2d.drawLine(10 , 50 , 190 , 50);
                }
                catch (DocumentException de)
                {
                        System.out.println("La génération a échoué");
                        return;
                }
                catch (IOException ioe)
                {
                        System.out.println("La génération a échoué Exception = 
") ;
                        return;
                }
                document.close();
                System.out.println("Fichier généré");
        }
}

Attachment: essai.pdf
Description: Adobe PDF document

No virus found in this outgoing message.
Checked by AVG.
Version: 8.0.100 / Virus Database: 269.24.2/1471 - Release Date: 28/05/2008 
17:33
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Reply via email to