msathiaraj
Joined: 22 Jun 2007 Posts: 1
|
Posted: Fri Jun 22, 2007 10:54 am Post subject: Problem in Print Offset |
|
|
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 |
|
Thomas Hoevel
Joined: 16 Oct 2006 Posts: 387 Location: Cologne, Germany
|
Posted: Mon Jun 25, 2007 8:10 am Post subject: |
|
|
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 |
|