Ejemplo n.º 1
0
 /// <summary>
 /// PDF Event Hendler om header alleen op 1e pagina en footer juist alleen op volgende pagina's te tonen
 /// </summary>
 /// <param name="eventParams"></param>
 void pdfConverter_PrepareRenderPdfPageEvent(PrepareRenderPdfPageParams eventParams)
 {
     // set the footer invisibility after 1st page
     if (eventParams.PageNumber > 1)
     {
         eventParams.Page.ShowFooter = false;
     }
 }
Ejemplo n.º 2
0
 static void htmlToPdfConverter_PrepareRenderPdfPageEvent(PrepareRenderPdfPageParams eventParams)
 {
     if (eventParams.PageNumber == 1)
     {
         PdfPage page = eventParams.Page;
         page.ShowHeader = false;
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// The handler for HtmlToPdfConverter.PrepareRenderPdfPageEvent event where you can set the visibility of header and footer
        /// in each page or you can add a custom header or footer in a page
        /// </summary>
        /// <param name="eventParams">The event parameter containin the PDF page to customize before rendering</param>
        void htmlToPdfConverter_PrepareRenderPdfPageEvent(PrepareRenderPdfPageParams eventParams)
        {
            if ((eventParams.PageNumber == 1) && changeHeaderAndFooterCheckBox.Checked)
            {
                // Change the header and footer in first page with an alternative header and footer

                // The PDF page being rendered
                PdfPage pdfPage = eventParams.Page;

                // Add a custom header of 80 points in height to this page
                // The default document header will be replaced in this page
                pdfPage.AddHeaderTemplate(80);
                // Draw the page header elements
                DrawAlternativePageHeader(pdfPage.Header, true);

                // Add a custom footer of 80 points in height to this page
                // The default document footer will be replaced in this page
                pdfPage.AddFooterTemplate(80);
                // Draw the page header elements
                DrawAlternativePageFooter(pdfPage.Footer, true, true);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// The handler for HtmlToPdfElement.PrepareRenderPdfPageEvent event where you can set the visibility of header and footer
        /// in each page or you can add a custom header or footer in a page
        /// </summary>
        /// <param name="eventParams">The event parameter containin the PDF page to customize before rendering</param>
        void htmlToPdfElement_PrepareRenderPdfPageEvent(PrepareRenderPdfPageParams eventParams)
        {
            // Set the header visibility in first, odd and even pages
            if (formCollection["addHeaderCheckBox"].Count > 0)
            {
                if (eventParams.PageNumber == 1)
                {
                    eventParams.Page.ShowHeader = formCollection["showHeaderInFirstPageCheckBox"].Count > 0;
                }
                else if ((eventParams.PageNumber % 2) == 0 && !(formCollection["showHeaderInEvenPagesCheckBox"].Count > 0))
                {
                    eventParams.Page.ShowHeader = false;
                }
                else if ((eventParams.PageNumber % 2) == 1 && !(formCollection["showHeaderInOddPagesCheckBox"].Count > 0))
                {
                    eventParams.Page.ShowHeader = false;
                }
            }

            // Set the footer visibility in first, odd and even pages
            if (formCollection["addFooterCheckBox"].Count > 0)
            {
                if (eventParams.PageNumber == 1)
                {
                    eventParams.Page.ShowFooter = formCollection["showFooterInFirstPageCheckBox"].Count > 0;
                }
                else if ((eventParams.PageNumber % 2) == 0 && !(formCollection["showFooterInEvenPagesCheckBox"].Count > 0))
                {
                    eventParams.Page.ShowFooter = false;
                }
                else if ((eventParams.PageNumber % 2) == 1 && !(formCollection["showFooterInOddPagesCheckBox"].Count > 0))
                {
                    eventParams.Page.ShowFooter = false;
                }
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// The handler for HtmlToPdfElement.PrepareRenderPdfPageEvent event where you can set the visibility of header and footer
        /// in each page or you can add a custom header or footer in a page
        /// </summary>
        /// <param name="eventParams">The event parameter containin the PDF page to customize before rendering</param>
        void htmlToPdfElement_PrepareRenderPdfPageEvent(PrepareRenderPdfPageParams eventParams)
        {
            // Set the header visibility in first, odd and even pages
            if (addHeaderCheckBox.Checked)
            {
                if (eventParams.PageNumber == 1)
                {
                    eventParams.Page.ShowHeader = showHeaderInFirstPageCheckBox.Checked;
                }
                else if ((eventParams.PageNumber % 2) == 0 && !showHeaderInEvenPagesCheckBox.Checked)
                {
                    eventParams.Page.ShowHeader = false;
                }
                else if ((eventParams.PageNumber % 2) == 1 && !showHeaderInOddPagesCheckBox.Checked)
                {
                    eventParams.Page.ShowHeader = false;
                }
            }

            // Set the footer visibility in first, odd and even pages
            if (addFooterCheckBox.Checked)
            {
                if (eventParams.PageNumber == 1)
                {
                    eventParams.Page.ShowFooter = showFooterInFirstPageCheckBox.Checked;
                }
                else if ((eventParams.PageNumber % 2) == 0 && !showFooterInEvenPagesCheckBox.Checked)
                {
                    eventParams.Page.ShowFooter = false;
                }
                else if ((eventParams.PageNumber % 2) == 1 && !showFooterInOddPagesCheckBox.Checked)
                {
                    eventParams.Page.ShowFooter = false;
                }
            }
        }
Ejemplo n.º 6
0
 void pdfConvertorExecutiveSummary_PrepareRenderPdfPageEvent(PrepareRenderPdfPageParams eventParams)
 {
     if (eventParams.PageNumber > 1)
     {
         eventParams.Page.Margins.Top = 56;
         eventParams.Page.Margins.Bottom = 56;
         eventParams.Page.ShowFooter = false;
     }
 }
        void pdfConverter_PrepareRenderPdfPageEvent(PrepareRenderPdfPageParams eventParams)
        {
            // set the header and footer visibility on first, odd and even pages
            if (cbShowFooter.Checked)
            {
                if (eventParams.PageNumber == 1 && !cbShowFooterOnFirstPage.Checked)
                    eventParams.Page.ShowFooter = false;
                else if ((eventParams.PageNumber % 2) == 0 && !cbShowFooterOnEvenPages.Checked)
                    eventParams.Page.ShowFooter = false;
                else if ((eventParams.PageNumber % 2) == 1 && !cbShowFooterOnOddPages.Checked)
                    eventParams.Page.ShowFooter = false;
            }

            if (cbShowHeader.Checked)
            {
                if (eventParams.PageNumber == 1 && !cbShowHeaderOnFirstPage.Checked)
                    eventParams.Page.ShowHeader = false;
                else if ((eventParams.PageNumber % 2) == 0 && !cbShowHeaderOnEvenPages.Checked)
                    eventParams.Page.ShowHeader = false;
                else if ((eventParams.PageNumber % 2) == 1 && !cbShowHeaderOnOddPages.Checked)
                    eventParams.Page.ShowHeader = false;
            }
        }
Ejemplo n.º 8
0
 static void htmlToPdfConverter_PrepareRenderPdfPageEvent(PrepareRenderPdfPageParams eventParams)
 {
     if (eventParams.PageNumber == 1)
     {
         PdfPage page = eventParams.Page;
         page.ShowHeader = false;
     }
 }
 private void htmlToPdfConverter_PrepareRenderPdfPageEvent(PrepareRenderPdfPageParams eventParams)
 {
     eventParams.Page.ShowHeader = true;
     eventParams.Page.ShowFooter = true;
 }