PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 4:14 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Problem in Print Offset
PostPosted: Fri Jun 22, 2007 10:54 am 
Offline

Joined: Fri Jun 22, 2007 10:38 am
Posts: 1
Hi,
I have created one Business Card (pdf format). Then i created a pdf file through codes which has multiple instance of the prepared car. The code which creates the final file is ..

Public Sub myCreatePrintVersionPDF(ByVal strFileName As String, _
ByVal Rows As Integer, _
ByVal Cols As Integer, _
ByVal Xmargin As Integer, _
ByVal Ymargin As Integer, _
ByVal CardWidth As Integer, _
ByVal CardHeight As Integer, _
ByVal HorizontalPitch As Integer, _
ByVal VerticalPitch As Integer, _
ByVal HorizontalSpace As Integer, _
ByVal VerticalSpace As Integer)

' Get fresh copy of the source PDF file
Dim SourceFile As String = strFileName
' Create the output document
Dim outputDocument As New PdfDocument()
Dim gfx As XGraphics
Dim form1 As XPdfForm = XPdfForm.FromFile(SourceFile)
Dim page1 As PdfPage = outputDocument.AddPage()


'Setting values for test instead of passing parameters
Xmargin = 10
Ymargin = 10
Rows = 4
Cols = 1
HorizontalSpace = 10
VerticalSpace = 10
CardWidth = form1.Width
CardHeight = form1.Height
HorizontalPitch = CardWidth + HorizontalSpace
VerticalPitch = CardHeight + VerticalSpace


'page1.Width = XUnit.FromMillimeter(Xmargin + HorizontalPitch * Cols)
'page1.Height = XUnit.FromMillimeter(Ymargin + VerticalPitch * Rows)

page1.Width = XUnit.FromPoint(Xmargin + HorizontalPitch * (Cols + 1) - HorizontalSpace + Xmargin)
page1.Height = XUnit.FromPoint(Ymargin + VerticalPitch * (Rows + 1) - VerticalSpace + Ymargin)

gfx = XGraphics.FromPdfPage(page1)
Dim Row, Col As Integer
For Row = 0 To Rows
For Col = 0 To Cols
'gfx.DrawImage(form1, New XRect(10, i * (form1.Height + 5) + 10, form1.Width, form1.Height))
gfx.DrawImage(form1, Xmargin + HorizontalPitch * Col, Ymargin + VerticalPitch * Row, form1.Width, form1.Height)
Next Col
Next Row
outputDocument.Save("C:\PrintVersionPDF.pdf")
gfx.Dispose()
outputDocument.Close()
outputDocument.Dispose()


End Sub


The Problem is the PDF file gets generated as expected but the left portion of the business card gets truncated. Is there any soulution for this.

_________________
FROM PDF


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Jun 25, 2007 8:10 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
Hi!
I'm not sure if I understand your problem.

If the PDF file looks correct, but something is missing from the print-out then this is a printer problem or printer feature.

Every printer has a non-printing area. Typically this is 7mm (approx. 0.25") for laser printers, but can be 3cm (more than 1") for the bottom margin on ink jet printers.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 42 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