Package com.itextpdf.text.pdf

Examples of com.itextpdf.text.pdf.PdfReader$PageRefs


        Assert.assertTrue("Content length should be set.", response.getContentLength() > -1);
        InputStream stream = response.getInputStream();
        byte[] result = new byte[response.getContentLength()];
        stream.read(result);

        PdfReader reader = new PdfReader(result);
        Assert.assertEquals("Expected a valid pdf file with a single page", 1, reader.getNumberOfPages());

    }
View Full Code Here


        InputStream stream = response.getInputStream();
        byte[] result = new byte[9000];
        stream.read(result);

        PdfReader reader = new PdfReader(result);
        // byte[] page = reader.getPageContent(1);
        Assert.assertEquals("Expected a valid pdf file with a single page", 1, reader.getNumberOfPages());

        return result;
    }
View Full Code Here

        InputStream stream = response.getInputStream();
        byte[] result = new byte[3000];
        stream.read(result);

        PdfReader reader = new PdfReader(result);
        Assert.assertEquals("Expected a valid pdf file with a single page", 1, reader.getNumberOfPages());

        // @todo assert expected content.

    }
View Full Code Here

     * @param pdfFile  a File instance referring to a PDF file
     * @param out       the output stream to send the content to
     * @throws IOException
     */
    static public void listContentStream(File pdfFile, PrintWriter out) throws IOException {
        PdfReader reader = new PdfReader(pdfFile.getCanonicalPath());

        int maxPageNum = reader.getNumberOfPages();

        for (int pageNum = 1; pageNum <= maxPageNum; pageNum++){
            listContentStreamForPage(reader, pageNum, out);
        }

View Full Code Here

     * @param pageNum   the page number to read
     * @param out       the output stream to send the content to
     * @throws IOException
     */
    static public void listContentStream(File pdfFile, int pageNum, PrintWriter out) throws IOException {
        PdfReader reader = new PdfReader(pdfFile.getCanonicalPath());

        listContentStreamForPage(reader, pageNum, out);
    }
View Full Code Here

    FileOutputStream streamOut = null;

    try {
      streamIn = new FileInputStream(templateFile);
      streamOut = new FileOutputStream(outputFile);
      PdfReader reader = new PdfReader(streamIn);
      PdfStamper stamp = new PdfStamper(reader, streamOut);
      AcroFields form = stamp.getAcroFields();

      if (fontfolder != null) {
        ArrayList<BaseFont> substitutionFonts = new ArrayList<BaseFont>();
View Full Code Here

    PdfCopyFields collection = new PdfCopyFields(streamOut);
    for (String producedFile : producedFiles) {
      FileInputStream streamIn = null;
      try {
        streamIn = new FileInputStream(outputfolder + File.separator + producedFile);
        PdfReader reader = new PdfReader(streamIn);
        collection.addDocument(reader);
      } catch (Exception e) {
        noticeTexts.add("ERROR: could not add " + producedFile + " to " + collectionFilename + " : " + e);
      } finally {
        FileUtils.close(streamIn);
View Full Code Here

     * @param pdfFile  a File instance referring to a PDF file
     * @param out       the output stream to send the content to
     * @throws IOException
     */
    static public void listContentStream(File pdfFile, PrintWriter out) throws IOException {
        PdfReader reader = new PdfReader(pdfFile.getCanonicalPath());

        int maxPageNum = reader.getNumberOfPages();

        for (int pageNum = 1; pageNum <= maxPageNum; pageNum++){
            listContentStreamForPage(reader, pageNum, out);
        }

View Full Code Here

     * @param pageNum   the page number to read
     * @param out       the output stream to send the content to
     * @throws IOException
     */
    static public void listContentStream(File pdfFile, int pageNum, PrintWriter out) throws IOException {
        PdfReader reader = new PdfReader(pdfFile.getCanonicalPath());

        listContentStreamForPage(reader, pageNum, out);
    }
View Full Code Here

      X509Certificate certificate = (X509Certificate) chain[0];

      DigestType digestType = this.getDigestTypeFromSignature(certificate.getSigAlgName());
      Calendar calendar = Calendar.getInstance();

      PdfReader reader = new PdfReader(data);
      PdfStamper stamper = PdfStamper.createSignature(reader, outputStream, PDFSigner.PDF_SIGNATURE_VERSION, null, true);

      PdfSignatureAppearance appearance = stamper.getSignatureAppearance();

      if (this.parameters.getSignatureInfo() != null) {
View Full Code Here

TOP

Related Classes of com.itextpdf.text.pdf.PdfReader$PageRefs

Copyright © 2018 www.massapicom. 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.