PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

join 3 bank receipts
https://forum.pdfsharp.net/viewtopic.php?f=2&t=1702
Page 1 of 1

Author:  karbunko [ Wed Jun 22, 2011 4:44 pm ]
Post subject:  join 3 bank receipts

Hi people,

I have been using PDFSharp.dll just for join pdfs generated by crystal reports.
I Use this code:

Code:
            using (MemoryStream strm = new MemoryStream(contenido))
            {
                // Open the document to import pages from it.
                using (PdfDocument inputDocument = PdfSharp.Pdf.IO.PdfReader.Open(strm, PdfSharp.Pdf.IO.PdfDocumentOpenMode.Import))
                {
                    // Iterate pages
                    int count = inputDocument.PageCount;
                    for (int idx = 0; idx < count; idx++)
                    {
                        // Get the page from the external document...
                        PdfPage page = inputDocument.Pages[idx];
                        // ...and add it to the output document.
                        outputDocument.AddPage(page);
                    }
                    strm.Close();
                }
            }


Now I have to join 3 bank receipts (bank drafts) in one page.
I the original pdfs, each receipts is in one page, wasting the 2/3 of space, and during the join I want to convert them in just one document of one page.

Is this possible with PDFSharp? Is this easy?

Author:  () => true [ Thu Jun 23, 2011 10:02 am ]
Post subject:  Re: join 3 bank receipts

karbunko wrote:
Is this possible with PDFSharp?

That depends on the receipts.

karbunko wrote:
Is this easy?

That depends on the receipts.

In Adobe Reader you can activate the Transparency Grid (via Edit -> Options -> Display or so).
If the wasted space is transparent, the task is pretty simple.
If the wasted space is not transparent, but at the bottom (or top) of the page, the task is still pretty simple.

Just look at the Two Pages on One sample, don't shrink the pages, draw them at different positions (if pages are not transparent, then draw them in the correct order).

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/