1 Reply Latest reply: Sep 22, 2006 5:26 AM by mlk RSS

    Sorry, here's the code for 2 solution in writing a pdf to file

    807598
      //First solution
      String outfile = "D:\\At Work\\Tags\\Release 3.7\\2476\\output.pdf";
      PdfReader r1 = new PdfReader("D:\\At Work\\Tags\\Release 3.7\\2476\\textfield.pdf");
      PdfStamper stamper = new PdfStamper(r1,new FileOutputStream(outfile));
      stamper.close();


      //Second Solution
      String outfile = "D:\\At Work\\Tags\\Release 3.7\\2476\\output.pdf";
      PdfReader r = new PdfReader("D:\\At Work\\Tags\\Release 3.7\\2476\\textfield.pdf");
      PdfCopyFields copy = new PdfCopyFields(new FileOutputStream(outfile));
      copy.addDocument(this);
      copy.close();