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


C# PdfTemplate.GetMcElements方法代碼示例

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


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

示例1: AddTemplate

         /**
         * Adds a template to this content.
         *
         * @param template the template
         * @param a an element of the transformation matrix
         * @param b an element of the transformation matrix
         * @param c an element of the transformation matrix
         * @param d an element of the transformation matrix
         * @param e an element of the transformation matrix
         * @param f an element of the transformation matrix
         * @param tagContent <code>true</code> - template content will be tagged(all that will be added after), <code>false</code> - only a Do operator will be tagged.
         *                   taken into account only if <code>isTagged()</code> - <code>true</code>.
         */
        public void AddTemplate(PdfTemplate template, float a, float b, float c, float d, float e, float f, bool tagContent) {
            CheckWriter();
            CheckNoPattern(template);
            PdfWriter.CheckPdfIsoConformance(writer, PdfIsoKeys.PDFISOKEY_FORM_XOBJ, template);
            PdfName name = writer.AddDirectTemplateSimple(template, null);
            PageResources prs = PageResources;
            name = prs.AddXObject(name, template.IndirectReference);
            if (IsTagged()) {
                if (inText)
                    EndText();
                if (template.ContentTagged || (template.PageReference != null && tagContent)) {
                    throw new InvalidOperationException(MessageLocalization.GetComposedMessage("template.with.tagged.could.not.be.used.more.than.once"));
                }

                template.PageReference = writer.CurrentPage;

                if (tagContent) {
                    template.ContentTagged = true;
                    IList<IAccessibleElement> allMcElements = GetMcElements();
                    if (allMcElements != null && allMcElements.Count > 0)
                        template.GetMcElements().Add(allMcElements[allMcElements.Count - 1]);
                } else {
                    OpenMCBlock(template);
                }
            }

            content.Append("q ");
            content.Append(a).Append(' ');
            content.Append(b).Append(' ');
            content.Append(c).Append(' ');
            content.Append(d).Append(' ');
            content.Append(e).Append(' ');
            content.Append(f).Append(" cm ");
            content.Append(name.GetBytes()).Append(" Do Q").Append_i(separator);

            if (IsTagged() && !tagContent) {
                CloseMCBlock(template);
                template.ID = null;
            }
        }
開發者ID:NelsonSantos,項目名稱:fyiReporting-Android,代碼行數:53,代碼來源:PdfContentByte.cs

示例2: CreateTemplate

        internal PdfTemplate CreateTemplate(float width, float height, PdfName forcedName) {
            CheckWriter();
            PdfTemplate template = new PdfTemplate(writer);
            IList<IAccessibleElement> allMcElements = GetMcElements();
            if(allMcElements != null && allMcElements.Count > 0)
                template.GetMcElements().Add(allMcElements[allMcElements.Count - 1]);

            template.Width = width;
            template.Height = height;
            writer.AddDirectTemplateSimple(template, forcedName);
            return template;
        }
開發者ID:,項目名稱:,代碼行數:12,代碼來源:


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