PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Apr 27, 2024 11:56 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Jul 31, 2013 10:13 pm 
Offline

Joined: Wed Jul 31, 2013 10:05 pm
Posts: 2
Hello,

I am adding a watermark to existing PDF's using method 3 in the example (except in the bottom Left corner). I add the watermark to each PDF and then merge them together. I noticed that one of the PDF's was not showing the watermark. If I mess with the XPoint and treat the bottom left corner as (0,PdfPage.Height*2) I can make it show up. All the other PDF's appear to treat the bottom left corner as (0,PdfPage.Height). The top left corner for the odd PDF is (0,PdfPage.Height), while the others appear to be (0,0).

All the documents are in portrait orientation and have no rotation (according to their properties). I've scoured the object propeties while debugging and can't find any that would indicate this behavior. Is there a property I can look at in a PdfPage or PdfDocument to predict this sort of behavior? If I could do that this problem could be fixed real easy.

I am using the latest version of PDFshard GDI+.

Thanks!
Kyle


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 01, 2013 6:50 pm 
Offline
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 340
Hi!

Did you check all the boxes that can be set for a PDF file? IIRC there are Bleed Box, Art Box, Media Box (ir similar names) and some more.

_________________
Öhmesh Volta ("() => true")
PDFsharp Team Holiday Substitute


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 02, 2013 6:02 pm 
Offline

Joined: Wed Jul 31, 2013 10:05 pm
Posts: 2
I am looking at those now.

TrimBox/BleedBox/ArtBox are all 0's with IsEmpty = true.
MediaBox is:

- MediaBox X1="0", X2="594", Y1="0", Y2="792" PdfSharp.Pdf.PdfRectangle
base X1="0", X2="594", Y1="0", Y2="792" PdfSharp.Pdf.PdfItem {PdfSharp.Pdf.PdfRectangle}
Height 792.0 double
IsEmpty false bool
+ Location X="0", Y="0" PdfSharp.Drawing.XPoint
+ Size Width="594", Height="792" PdfSharp.Drawing.XSize
Width 594.0 double
X1 0.0 double
X2 594.0 double
Y1 0.0 double
Y2 792.0 double


This appears to be consistent with my other PDF's as well. I thought it could be the version property, but that wasn't the case either. I've also looked at the XGraphics I pull from XGraphics.FromPdfPage() and can not find anything either. Maybe there is an overload I can use on XGraphics.FromPdfPage()?

Thanks!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 356 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group