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


C# PdfWriter.GetImportedPage方法代碼示例

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


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

示例1: EmbedeIntroPage

       private static void EmbedeIntroPage(Document pdfDoc, PdfWriter writer)
       {
           pdfDoc.NewPage();
           PdfReader reader = new PdfReader(Resources.Intro);
           PdfContentByte cb = writer.DirectContent;
           PdfImportedPage page = writer.GetImportedPage(reader, 1); ;

           //cb.AddTemplate(page, 0, -1f, 1f, 0, 0, reader.GetPageSizeWithRotation(1).Height);
           cb.AddTemplate(page, 0, 0);
       }
開發者ID:samuraitruong,項目名稱:comitdownloader,代碼行數:10,代碼來源:PDFHelper.cs

示例2: OnOpenDocument

        public void OnOpenDocument(PdfWriter writer, Document document)
        {
            _baseFont = BaseFont.CreateFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.EMBEDDED);
            _frontPageFont = BaseFont.CreateFont(BaseFont.HELVETICA_BOLD, BaseFont.CP1252, BaseFont.EMBEDDED);
            _content = writer.DirectContent;

            if (!string.IsNullOrEmpty(_settings.PageTemplate))
            {
                var reader = new PdfReader(_settings.PageTemplate);
                _template = writer.GetImportedPage(reader, 1);
            }

            WriteFrontPage(writer, document);
        }
開發者ID:marcostomazini,項目名稱:ReleaseNotes,代碼行數:14,代碼來源:ReleaseNotesPdfPageEvents.cs

示例3: GenerateDocument

 protected override void GenerateDocument(Document doc, DocumentType docType, string addSheet, PdfWriter writer)
 {
     DepartmentOrderDocTableAdapters.DocumentContentTableAdapter ta = new DepartmentOrderDocTableAdapters.DocumentContentTableAdapter();
     IEnumerator iEnum = ta.GetDocumentContentById(docType.DocId, docType.CoId, docType.DeptId).GetEnumerator();
     if (iEnum.MoveNext())
     {
         DepartmentOrderDoc.DocumentContentEntityRow docContent = (DepartmentOrderDoc.DocumentContentEntityRow)iEnum.Current;
         if (docContent.file_contents != null && docContent.file_contents.Length > 0)
         {
             PdfContentByte pdfContentByte = writer.DirectContent;
             PdfReader reader = new PdfReader(docContent.file_contents);
             for (int page = 1; page <= reader.NumberOfPages; page++)
             {
                 doc.NewPage();
                 PdfImportedPage importedPage = writer.GetImportedPage(reader, page);
                 pdfContentByte.AddTemplate(importedPage, 0, 0);
             }
         }
     }
 }
開發者ID:ali-codehoppers,項目名稱:unchsunchs,代碼行數:20,代碼來源:SignageGenerator.cs

示例4: WriteFrontPage

        private void WriteFrontPage(PdfWriter writer, Document document)
        {
            if (!string.IsNullOrEmpty(_settings.FrontPageTemplate))
            {
                document.NewPage();

                // Write Generated On
                string title = _settings.GetDocumentTitle();

                _content.BeginText();
                _content.SetFontAndSize(_frontPageFont, HeadingFontSize);
                _content.SetTextMatrix(GetFrontPageTextXPosition(title, writer), GetFrontPageTextYPosition(writer));
                _content.ShowText(title);
                _content.EndText();

                var reader = new PdfReader(_settings.FrontPageTemplate);
                writer.DirectContentUnder.AddTemplate(writer.GetImportedPage(reader, 1), 0, 0);
                _skipPageFooter = true;
            }
        }
開發者ID:marcostomazini,項目名稱:ReleaseNotes,代碼行數:20,代碼來源:ReleaseNotesPdfPageEvents.cs

示例5: UseStationary

 /**
  * Initialize the imported page.
  * @param writer The PdfWriter
  */
 public void UseStationary(PdfWriter writer, byte[] stationary) {
   writer.PageEvent = new TemplateHelper(this);
   PdfReader reader = new PdfReader(stationary);
   page = writer.GetImportedPage(reader, 1);
 }
開發者ID:,項目名稱:,代碼行數:9,代碼來源:

示例6: BuildFile

        protected override void BuildFile()
        {
            if (TemplateStream != null)
            {
                readerFileTemplate = new PdfReader(TemplateStream);
                document = new Document(readerFileTemplate.GetPageSize(1));
                writer = PdfWriter.GetInstance(document, BufferStream);
                document.Open();

                var page = writer.GetImportedPage(readerFileTemplate, 1);
                Template = page;
                writer.DirectContent.AddTemplate(page, 0, 0);
            }
            else
            {
                var size = IPageSize.GetRectangle(DocumentPageSize.ToString());
                if (IsPageRotate) size = size.Rotate();
                document = DocumentMargin == Margin.Empty ? new Document(size) :
                        new Document(size, DocumentMargin.Left, DocumentMargin.Right, DocumentMargin.Top, DocumentMargin.Bottom);
                writer = PdfWriter.GetInstance(document, BufferStream);
                document.Open();
                AddEmpty();
            }

            Height = document.PageSize.Height;
            Width = document.PageSize.Width;
        }
開發者ID:Dason1986,項目名稱:Lib,代碼行數:27,代碼來源:PDFBuilder.cs

示例7: GetImage

 public Image GetImage(PdfWriter writer)
 {
     var reader = new PdfReader(source);
     var pdfImportedPage = writer.GetImportedPage(reader, 1);
     return Image.GetInstance(pdfImportedPage);
 }
開發者ID:asgerhallas,項目名稱:DomFx,代碼行數:6,代碼來源:iTextSharpVectorImage.cs


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