當前位置: 首頁>>代碼示例>>C#>>正文


C# PdfReader.IsTagged方法代碼示例

本文整理匯總了C#中iTextSharp.text.pdf.PdfReader.IsTagged方法的典型用法代碼示例。如果您正苦於以下問題:C# PdfReader.IsTagged方法的具體用法?C# PdfReader.IsTagged怎麽用?C# PdfReader.IsTagged使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在iTextSharp.text.pdf.PdfReader的用法示例。


在下文中一共展示了PdfReader.IsTagged方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: isPdfAccessible

        public DacReport isPdfAccessible(String sourceFile)
        {
            DacReport dr = new DacReport();
            PdfReader reader = new PdfReader(sourceFile);
            if (reader.IsTagged())
            {
                dr.IsTagged = true;
                var trailerKeys = reader.Trailer.Keys;

                var catalogKeys = reader.Catalog.Keys;

                //continue checking for accessibility, possibly follow the Matterhorn Protocol
                /*
                 * 01-003 Content marked as Artifact is present inside tagged content.
                 * 01-004 Tagged content is present inside content marked as Artifact.
                 * 01-005 Content is neither marked as Artifact nor tagged as real content.
                 * 01-007 Suspect entry has a value of true.
                 * 02-001 One or more non-standard tag’s mapping does not terminate with a standard type.
                 * 02-003 A circular mapping exists.
                 * 02-004 One or more standard types are remapped.
                 * 06-001 Document does not contain XMP metadata stream
                 * 06-002 The metadata stream in the Catalog dictionary does not include the PDF/UA identifier.
                 * 06-003 Metadata stream does not contain dc:title
                 * 07-001 ViewerPreferences dictionary of the Catalog dictionary does not contain DisplayDocTitle key.
                 * 07-002 ViewerPreferences dictionary of the Catalog dictionary contains DisplayDocTitle key with a value of false.
                 * 09-004 A table-related structure element is used in a way that does not conform to the syntax defined in ISO 32000-1, Table 337.
                 * 09-005 A list-related structure element is used in a way that does not conform to Table 336 in ISO 32000-1.
                 * 09-006 A TOC-related structure element is used in a way that does not conform to Table 333 in ISO 32000-1.
                 * 09-007 A Ruby-related structure element is used in a way that does not conform to Table 338 in ISO 32000-1.
                 * 09-008 A Warichu-related structure element is used in a way that does not conform to Table 338 in ISO 32000-1.
                 * 10-001 Character code cannot be mapped to Unicode.
                 * 11-001 Natural language for text in page content cannot be determined.
                 * 11-002 Natural language for text in “Alt”, “ActualText” and “E” attributes cannot be determined.
                 * 11-003 Natural language in the Outline entries cannot be determined.
                 * 11-004 Natural language in the “Contents” entry for annotations cannot be determined.
                 * 11-005 Natural language in the TU key for form fields cannot be determined.
                 * 11-006 Natural language for document metadata cannot be determined.
                 * 13-004 Figure tag alternative or replacement text missing.
                 * 14-002 Does use numbered headings, but the first heading tag is not H1.
                 * 14-003 Numbered heading levels in descending sequence are skipped (Example: H3 follows directly after H1).
                 */
            }
            else
            {
                dr.IsTagged = false;
            }
            return dr;
        }
開發者ID:sensusaps,項目名稱:RoboBraille.Web.API,代碼行數:48,代碼來源:DacChecker.cs

示例2: PdfStamperImp

        /** Creates new PdfStamperImp.
        * @param reader the read PDF
        * @param os the output destination
        * @param pdfVersion the new pdf version or '\0' to keep the same version as the original
        * document
        * @param append
        * @throws DocumentException on error
        * @throws IOException
        */
        internal protected PdfStamperImp(PdfReader reader, Stream os, char pdfVersion, bool append) : base(new PdfDocument(), os) {
            if (!reader.IsOpenedWithFullPermissions)
                throw new BadPasswordException(MessageLocalization.GetComposedMessage("pdfreader.not.opened.with.owner.password"));
            if (reader.Tampered)
                throw new DocumentException(MessageLocalization.GetComposedMessage("the.original.document.was.reused.read.it.again.from.file"));
            reader.Tampered = true;
            this.reader = reader;
            file = reader.SafeFile;
            this.append = append;
            if (reader.IsEncrypted() && (append || PdfReader.unethicalreading)) {
                crypto = new PdfEncryption(reader.Decrypt);
            }
            if (append) {
                if (reader.IsRebuilt())
                    throw new DocumentException(MessageLocalization.GetComposedMessage("append.mode.requires.a.document.without.errors.even.if.recovery.was.possible"));
                pdf_version.SetAppendmode(true);
                if (pdfVersion == 0) {
                    pdf_version.PdfVersion = reader.PdfVersion;
                }
                else {
                    pdf_version.PdfVersion = pdfVersion;
                }
                byte[] buf = new byte[8192];
                int n;
                while ((n = file.Read(buf)) > 0)
                    this.os.Write(buf, 0, n);
                prevxref = reader.LastXref;
                reader.Appendable = true;
            }
            else {
                if (pdfVersion == 0)
                    base.PdfVersion = reader.PdfVersion;
                else
                    base.PdfVersion = pdfVersion;
            }

            if (reader.IsTagged()) {
                this.SetTagged();
            }

            base.Open();
            pdf.AddWriter(this);
            if (append) {
                body.Refnum = reader.XrefSize;
                marked = new IntHashtable();
                if (reader.IsNewXrefType())
                    fullCompression = true;
                if (reader.IsHybridXref())
                    fullCompression = false;
            }
            initialXrefSize = reader.XrefSize;
            ReadColorProfile();
        }
開發者ID:yu0410aries,項目名稱:itextsharp,代碼行數:62,代碼來源:PdfStamperImp.cs


注:本文中的iTextSharp.text.pdf.PdfReader.IsTagged方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。