table measurements and layout differences...
PDFsharp is a .NET library for creating and modifying PDF documents.
Brought to you by:
pdfsharp,
stefan_lange
After a while working on some other things (and moving from Texas to Ohio), I've been working with PDFSharp and Migradoc again for the past week or two. I'll be submitting some documentation for a few of the areas I've become familiar with in the next week or so.
First off, let me say thank you for developing both products. Without them, I'd be hard pressed to print PDFs in the background or easily build printable documents that include barcodes.
That said, I have seen one thing that I don't understand, and another that I have a question about.
After finding a number of ways to attempt to use Adobe Acrobat Reader to print in the background, I went back to migradoc and found the MigraDoc.Rendering.Printing.MigraDocPrintDocument class. I created a document, cloned it, rendered one copy with DocumentRenderer (which is what MigraDocPrintDocument requires), and another with PDFDocumentRenderer, which is what I have to use if I want to be able to save as a file (I have a need to do both for invoices).
I had no problem with the creation, but the printed documents were offset by about a half-inch down and to the right vs. the saved copies. I'm still running through some tests to try and see if I can identify what's causing the difference, but I was wondering if you knew of any issues in that respect. (Seems to be an issue regardless of whether I set relativehorizontal or relativevertical to margin or page).
Second, is there a way to get the height in as XUnit, inch, or other measurements of a table (migradoc question)? Alternatively, is there a way to specify that a table should split at a certain height and start on a new section? This (again) is something I'm looking at for the invoice document I'm working on, and I can see that I'll need to handle some formatting issues if the table is more than a certain height.
I will send this via email as well, but thought other users might appreciate seeing the question and answer.
Thank you.
Hi, drakaan!
Nice to from you again!
Please visit the PDFsharp discussion forum at http://pdfsharp.s3.bizhat.com/
Re: second question
Tables will split onto two or more pages automatically if they become too large.
Headers (columns and rows) will be repeated on each additional page.
AFAIK the size will be determined on rendering only; therefore I suppose there is no way to tell the height of the final table while creating the document.
Re: offset while printing
I think I can replicate the problem.
I created a PDF file via PDFsharp - and it's OK.
I created a PDF file printing to Adobe PDF - and it's OK.
I created a PDF file with Ghostscript after printing to a file with a PS printer - and it has this offset you mention.
This needs further investigation...
Regards
Thomas