Package com.itextpdf.text

Examples of com.itextpdf.text.Document.open()


      // Convierte el c�digo XHTML a PDF
      Document document = new Document();
      InputStream stream = new ByteArrayInputStream(xhtml.getBytes());

      PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(fileNamePath));
      document.open();
      XMLWorkerHelper.getInstance().parseXHtml(writer, document, stream);
      document.close();

      // Construye la URL de acceso al informe PDF generado
      URL url = new URL(workspace.getUrl());
View Full Code Here


      this.invoiceNumber = invoiceNumber;
      processMap(recordEntities);
     
      final Document document = new Document(PageSize.A4, 20, 20, 10, 10);
      PdfWriter.getInstance(document, new FileOutputStream(output));
      document.open();
     
      addMetaData(document);
      addTitle(document);
      addTable(document, skipEmptyRecords);
      addNotes(document);
View Full Code Here

 
  public void print() {
    Document document = new Document();
        try {
            PdfWriter.getInstance(document,new FileOutputStream("Totaal.pdf"));
            document.open();
            PdfPTable pdfTable = new PdfPTable(table.getColumnCount());
            pdfTable.setLockedWidth(false);
            PdfPCell cell = new PdfPCell();
            Phrase phrase = null;
            cell.setBackgroundColor(BaseColor.LIGHT_GRAY);
View Full Code Here

    {
      final ByteArrayOutputStream byteStream = new ByteArrayOutputStream();

      final Document document = new Document();
      PdfWriter.getInstance(document, byteStream);
      document.open();
      document.add(new Paragraph(TEXT1, font));
      document.newPage();
      document.add(new Paragraph(TEXT2, font));
      document.close();
View Full Code Here

        File testFile = TestResourceUtils.getResourceAsTempFile(this, "getLinkTest1.pdf");
        PdfReader currentReader = new PdfReader(testFile.getAbsolutePath());
        Document document = new Document(PageSize.A4, 0, 0, 0, 0);
        PdfWriter writer = PdfWriter.getInstance(document, new
                ByteArrayOutputStream());
        document.open();
        document.newPage();
        List links = currentReader.getLinks(1);
        PdfAnnotation.PdfImportedLink link =
            (PdfAnnotation.PdfImportedLink) links.get(0);
        writer.addAnnotation(link.createAnnotation(writer));
View Full Code Here

    File out;
   
    private void createTempFile(String filename, String[] pageContents) throws Exception{
        Document document = new Document();
        PdfWriter.getInstance(document, new FileOutputStream(filename));
        document.open();
       
        for (int i = 0; i < pageContents.length; i++) {
            if (i != 0)
                document.newPage();
View Full Code Here

    public void mergeAndStampPdf(boolean resetStampEachPage, File[] in, File out, File stamp) throws Exception {
        Document document = new Document();
       
        PdfCopy writer = new PdfSmartCopy(document, new FileOutputStream(out));
       
        document.open();
       
        int stampPageNum = 1;

        PdfReader stampReader = new PdfReader(stamp.getPath());
        for (int inNum = 0; inNum < in.length; inNum++){
View Full Code Here

    public void testProducer() throws Exception {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        Document document = new Document();

        PdfWriter.getInstance(document, baos);
        document.open();
        document.add(new Paragraph("Hello World"));
        document.close();
       
        PdfReader r = new PdfReader(baos.toByteArray());
View Full Code Here

        final Document document = new Document();
        PdfWriter writer = PdfWriter.getInstance(document, byteStream);
        document.setPageSize(PageSize.LETTER);

        document.open();

        PdfContentByte cb = writer.getDirectContent();

        BaseFont font = BaseFont.createFont();
       
View Full Code Here

        final Document document = new Document();
        PdfWriter writer = PdfWriter.getInstance(document, byteStream);
        document.setPageSize(PageSize.LETTER);

        document.open();

        PdfContentByte cb = writer.getDirectContent();

        BaseFont font = BaseFont.createFont();
       
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.