iTextSharp.text.pdf.PdfString.SetHexWriting C# (CSharp) Метод

SetHexWriting() публичный Метод

public SetHexWriting ( bool hexWriting ) : PdfString
hexWriting bool
Результат PdfString
        public PdfString SetHexWriting(bool hexWriting)
        {
            this.hexWriting = hexWriting;
            return this;
        }

Usage Example

Пример #1
0
        /**
         * Closes the document. No more content can be written after the
         * document is closed.
         * <p>
         * If closing a signed document with an external signature the closing must be done
         * in the <CODE>PdfSignatureAppearance</CODE> instance.
         * @throws DocumentException on error
         * @throws IOException on error
         */
        public void Close()
        {
            if (!hasSignature)
            {
                stamper.Close(moreInfo);
                return;
            }
            sigApp.PreClose();
            PdfSigGenericPKCS sig = sigApp.SigStandard;
            PdfLiteral        lit = (PdfLiteral)sig.Get(PdfName.CONTENTS);
            int totalBuf          = (lit.PosLength - 2) / 2;

            byte[] buf = new byte[8192];
            int    n;
            Stream inp = sigApp.RangeStream;

            while ((n = inp.Read(buf, 0, buf.Length)) > 0)
            {
                sig.Signer.Update(buf, 0, n);
            }
            buf = new byte[totalBuf];
            byte[] bsig = sig.SignerContents;
            Array.Copy(bsig, 0, buf, 0, bsig.Length);
            PdfString str = new PdfString(buf);

            str.SetHexWriting(true);
            PdfDictionary dic = new PdfDictionary();

            dic.Put(PdfName.CONTENTS, str);
            sigApp.Close(dic);
            stamper.reader.Close();
        }
All Usage Examples Of iTextSharp.text.pdf.PdfString::SetHexWriting