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

Different size for last page
https://forum.pdfsharp.net/viewtopic.php?f=2&t=2617
Page 1 of 1

Author:  senic [ Mon Oct 21, 2013 1:51 pm ]
Post subject:  Different size for last page

Hi

I've been searching for the following option but I couldn't find anything so far:

I need to print an invoice which has a credit slip on the last page. If the document is small, the credit slip is printed onto the first page, if however the document is larger, it's printed on the last page.

Is there any way I could achieve this with PDFSharp?

Attached you find an example of what I need (This is just the last page in the document, all other pages are regular, white pages).

Thank you a lot

senic

Attachments:
95279.jpg
95279.jpg [ 70.29 KiB | Viewed 6184 times ]

Author:  Thomas Hoevel [ Mon Oct 21, 2013 2:08 pm ]
Post subject:  Re: Different size for last page

Hi!
senic wrote:
Is there any way I could achieve this with PDFSharp?
With PDFsharp you can set the size for each page individually. With MigraDoc you can set the page size for each section.
Your code must determine when such a small page is needed.

Author:  senic [ Mon Oct 21, 2013 2:34 pm ]
Post subject:  Re: Different size for last page

Hi

So I should set the first page size to the small layout, and if the document is 2 pages or longer I should create a blank one and then add the shorter page at the end?
Or did I misunderstand you? Is there some more elegant way of achieving this?

Thanks a lot

senic

Author:  Thomas Hoevel [ Mon Oct 21, 2013 2:44 pm ]
Post subject:  Re: Different size for last page

Are we talking about different physical page sizes? Or just "logical" page sizes?
Do you intend to use PDFsharp (low-level functions) or MigraDoc (high-level functions)?

Author:  senic [ Mon Oct 21, 2013 2:57 pm ]
Post subject:  Re: Different size for last page

logical page sizes... They're the same size physically.

At the moment I was thinking about using PDFSharp, but should it be easier to accomplish my goal using MigraDoc I would consider switching.

Author:  Thomas Hoevel [ Mon Oct 21, 2013 3:21 pm ]
Post subject:  Re: Different size for last page

PDFsharp is a bit like MS Paint: you draw what you want and where you want it.
MigraDoc is a bit like Word: you specify page margins and enter paragraphs with your text, MigraDoc add line breaks and page breaks &c.

With MigraDoc you add tables, with PDFsharp you draw text and lines.

Adding the credit slip will be easier with PDFsharp, the rest will probably be easier with MigraDoc. You can mix them.
With what I know now, I think I would try a mix of MigraDoc and PDFsharp.

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