Package com.itextpdf.text.pdf

Examples of com.itextpdf.text.pdf.PRStream


        }
        PdfArray ocspArray = dictionary.getAsArray(PdfName.OCSPS);
        ArrayList<BasicOCSPResp> ocsps = new ArrayList<BasicOCSPResp>();
        if (ocspArray != null) {
            for (int i = 0; i < ocspArray.size(); i++) {
                PRStream stream = (PRStream) ocspArray.getAsStream(i);
                OCSPResp response = new OCSPResp(PdfReader.getStreamBytes(stream));
                BasicOCSPResp basicResponse = (BasicOCSPResp) response.getResponseObject();
                ocsps.add(basicResponse);
            }
        }
        PdfArray crlArray = dictionary.getAsArray(PdfName.CRLS);
        ArrayList<X509CRL> crls = new ArrayList<X509CRL>();
        if (crlArray != null) {
            for (int i = 0; i < crlArray.size(); i++) {
                PRStream stream = (PRStream) crlArray.getAsStream(i);
                X509CRL crl = (X509CRL) factory.generateCRL(new ByteArrayInputStream(PdfReader.getStreamBytes(stream)));
                crls.add(crl);
            }
        }
        if (ocsps.size() == 0 && crls.size() == 0) {
View Full Code Here


                    stride = (width * bpc * 3 + 7) / 8;
                    pngColorType = 2;
                }
            }
            else if (PdfName.ICCBASED.equals(tyca)) {
                PRStream pr = (PRStream)ca.getDirectObject(1);
                int n = pr.getAsNumber(PdfName.N).intValue();
                if (n == 1) {
                    stride = (width * bpc + 7) / 8;
                    pngColorType = 0;
                    icc = PdfReader.getStreamBytes(pr);
                }
View Full Code Here

            else if (colorspace instanceof PdfArray) {
                PdfArray ca = (PdfArray)colorspace;
                PdfObject tyca = ca.getDirectObject(0);
                if (!PdfName.ICCBASED.equals(tyca))
                    throw new UnsupportedPdfException(MessageLocalization.getComposedMessage("the.color.space.1.is.not.supported", colorspace));
                PRStream pr = (PRStream)ca.getDirectObject(1);
                int n = pr.getAsNumber(PdfName.N).intValue();
                if (n != 4) {
                    throw new UnsupportedPdfException(MessageLocalization.getComposedMessage("N.value.1.is.not.supported", n));
                }
                icc = PdfReader.getStreamBytes(pr);
            }
View Full Code Here

    PdfArray crlarray = dss.getAsArray(PdfName.CRLS);
    if (crlarray == null)
      return crls;
    CertificateFactory cf = CertificateFactory.getInstance("X.509");
    for (int i = 0; i < crlarray.size(); i++) {
      PRStream stream = (PRStream) crlarray.getAsStream(i);
      X509CRL crl = (X509CRL)cf.generateCRL(new ByteArrayInputStream(PdfReader.getStreamBytes(stream)));
      crls.add(crl);
    }
    return crls;
  }
View Full Code Here

      return ocsps;
    PdfArray ocsparray = dss.getAsArray(PdfName.OCSPS);
    if (ocsparray == null)
      return ocsps;
    for (int i = 0; i < ocsparray.size(); i++) {
      PRStream stream = (PRStream) ocsparray.getAsStream(i);
      OCSPResp ocspResponse = new OCSPResp(PdfReader.getStreamBytes(stream));
      if (ocspResponse.getStatus() == 0)
        try {
          ocsps.add((BasicOCSPResp) ocspResponse.getResponseObject());
        } catch (OCSPException e) {
View Full Code Here

                    stride = (width * bpc * 3 + 7) / 8;
                    pngColorType = 2;
                }
            }
            else if (PdfName.ICCBASED.equals(tyca)) {
                PRStream pr = (PRStream)ca.getDirectObject(1);
                int n = pr.getAsNumber(PdfName.N).intValue();
                if (n == 1) {
                    stride = (width * bpc + 7) / 8;
                    pngColorType = 0;
                    icc = PdfReader.getStreamBytes(pr);
                }
View Full Code Here

            else if (colorspace instanceof PdfArray) {
                PdfArray ca = (PdfArray)colorspace;
                PdfObject tyca = ca.getDirectObject(0);
                if (!PdfName.ICCBASED.equals(tyca))
                    return null;
                PRStream pr = (PRStream)ca.getDirectObject(1);
                int n = pr.getAsNumber(PdfName.N).intValue();
                if (n != 4) {
                    return null;
                }
                icc = PdfReader.getStreamBytes(pr);
            }
View Full Code Here

                final PRIndirectReference ref = (PRIndirectReference) contentObject;
                final PdfObject directObject = PdfReader.getPdfObject(ref);
                result = getContentBytesFromContentObject(directObject);
                break;
            case PdfObject.STREAM:
                final PRStream stream = (PRStream) PdfReader.getPdfObject(contentObject);
                result = PdfReader.getStreamBytes(stream);
                break;
            case PdfObject.ARRAY:
                // Stitch together all content before calling processContent(), because
                // processContent() resets state.
View Full Code Here

   
    private void prepareImageObject() throws IOException{
        if (imageObject != null)
            return;
       
        PRStream stream = (PRStream)PdfReader.getPdfObject(ref);
        imageObject = new PdfImageObject(stream);       
    }
View Full Code Here

    PdfArray crlarray = dss.getAsArray(PdfName.CRLS);
    if (crlarray == null)
      return crls;
    CertificateFactory cf = CertificateFactory.getInstance("X.509");
    for (int i = 0; i < crlarray.size(); i++) {
      PRStream stream = (PRStream) crlarray.getAsStream(i);
      X509CRL crl = (X509CRL)cf.generateCRL(new ByteArrayInputStream(PdfReader.getStreamBytes(stream)));
      crls.add(crl);
    }
    return crls;
  }
View Full Code Here

TOP

Related Classes of com.itextpdf.text.pdf.PRStream

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.