Examples of PRStream


Examples of com.itextpdf.text.pdf.PRStream

      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

Examples of com.itextpdf.text.pdf.PRStream

                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

Examples of com.itextpdf.text.pdf.PRStream

     * Gets an object containing the image dictionary and bytes.
     * @return an object containing the image dictionary and byte[]
     * @since 5.0.2
     */
    public PdfImageObject getImage() {
    PRStream stream = (PRStream)PdfReader.getPdfObject(ref);
    return new PdfImageObject(stream);
    }
View Full Code Here

Examples of com.itextpdf.text.pdf.PRStream

   * Renders the content stream of a PdfObject or empties the text area.
   * @param object  the object of which the content stream needs to be rendered
   */
  public void render(PdfObject object) {
    if (object instanceof PRStream) {
      PRStream stream = (PRStream)object;
      try {
        TextAreaOutputStream taos = new TextAreaOutputStream(text);
        taos.write(PdfReader.getStreamBytes(stream));
        //text.addMouseListener(new StreamEditorAction(stream));
      }
View Full Code Here

Examples of com.itextpdf.text.pdf.PRStream

   */
  @SuppressWarnings("unchecked")
        public void writeTo(OutputStream os) throws IOException {
    Enumeration<FormTreeNode> children = this.children();
    FormTreeNode node;
    PRStream stream;
    String key = null;
    String tmp = null;
    while (children.hasMoreElements()) {
      node = children.nextElement();
      if (key != null) {
View Full Code Here

Examples of com.itextpdf.text.pdf.PRStream

   *            a page dictionary
   * @throws IOException
   */
  public void parseTag(String tag, PdfObject object, PdfDictionary page)
      throws IOException {
    PRStream stream = (PRStream) page.getAsStream(PdfName.CONTENTS);
    // if the identifier is a number, we can extract the content right away
    if (object instanceof PdfNumber) {
      PdfNumber mcid = (PdfNumber) object;
      RenderFilter filter = new MarkedContentRenderFilter(mcid.intValue());
      TextExtractionStrategy strategy = new SimpleTextExtractionStrategy();
View Full Code Here

Examples of com.itextpdf.text.pdf.PRStream

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

Examples of com.itextpdf.text.pdf.PRStream

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

Examples of com.itextpdf.text.pdf.PRStream

                    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

Examples of com.itextpdf.text.pdf.PRStream

            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
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.