[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to remove border around drawings?

Posted on 2010-11-11
1
Medium Priority
?
509 Views
Last Modified: 2012-05-10
We have this program that is printing out drawings from eDrawing or Solidworks, but each time we print there is a border printed around the page about 0.4 inched in on the paper.
I have attached the code used to print drawings.
Can someone please help me figure out if there is something in this code that is causing the drawings to be printed with a border around them?
Private Sub PrintJob(ByVal _DocumentNumber As String, ByVal _Scale As String, ByVal _printerDevice As String, ByVal _printerPort As String, ByVal _SheetSize As String, ByVal _PrinterSize As String)

        Dim Orientation As EMVPrintOrientation 'Page orientation as defined in EMVPrintOrientation
        Dim PaperSize As Integer 'Use Windows printer constants (see Remarks)
        Dim PaperLength As Integer 'Custom size in thousandths of an inch, if you are not using a standard paper size
        Dim PaperWidth As Integer 'Custom size in thousandths of an inch
        Dim Copies As Integer = 1 'Number of copies
        Dim Source As Integer 'Paper tray source; use Windows printer constants
        Dim Printer As String = _printerPort
        Dim TopMargin As Integer 'Top margin in thousandths of an inch or 0 to use printer's margin
        Dim BottomMargin As Integer 'Bottom margin in thousandths of an inch or 0 to use printer's margin
        Dim LeftMargin As Integer 'Left margin in thousandths of an inch or 0 to use printer's margin
        Dim RightMargin As Integer 'Right margin in thousandths of an inch or 0 to use printer's margin

        Orientation = EMVPrintOrientation.ePortrait
        Select Case UCase(_PrinterSize)
            Case "ROLL"
                PaperSize = Printing.PaperSourceKind.TractorFeed 'A1
            Case "A3", "A4"
                PaperSize = Printing.PaperSourceKind.AutomaticFeed
        End Select

        Select Case _SheetSize
            Case "A4"
                PaperSize = Printing.PaperKind.A4
                PaperLength = 210
                PaperWidth = 297
                Orientation = EModelView.EMVPrintOrientation.ePortrait
            Case "A3"
                If _PrinterSize = "A4" Then
                    PaperSize = Printing.PaperKind.A4
                    PaperLength = 0
                    PaperWidth = 0
                Else
                    PaperSize = Printing.PaperKind.A3
                    PaperLength = 210
                    PaperWidth = 297
                End If
                Orientation = EModelView.EMVPrintOrientation.eLandscape
            Case "A2"
                If _PrinterSize = "A4" Then
                    PaperSize = Printing.PaperKind.A4
                    PaperLength = 210
                    PaperWidth = 297
                ElseIf InStr(_PrinterSize, "A3", CompareMethod.Text) > 0 Then
                    PaperSize = Printing.PaperKind.A3
                    PaperLength = 420
                    PaperWidth = 297
                Else
                    PaperSize = Printing.PaperKind.DSheet
                    PaperLength = 594
                    PaperWidth = 420
                End If
                Orientation = EModelView.EMVPrintOrientation.eLandscape
            Case "A1"
                Select Case _PrinterSize
                    Case "A4"
                        PaperSize = Printing.PaperKind.A4
                        PaperLength = 0 ' (210 / 25.4) * 10000
                        PaperWidth = 0 '(297 / 27.4) * 1000
                    Case "A3"
                        PaperSize = Printing.PaperKind.A3
                        PaperLength = 420
                        PaperWidth = 297
                    Case Else
                        PaperSize = Printing.PaperKind.ESheet   'DSheet=22 by 34 in
                        PaperLength = 841 ' 23 * 25.6 '(in*mm)
                        PaperWidth = 594 ' 36 * 25.6
                End Select
                Orientation = EModelView.EMVPrintOrientation.eLandscape
        End Select



        AxEModelViewControl1.SetPageSetupOptions(Orientation, PaperSize, PaperLength, PaperWidth, Copies, Source, Printer, TopMargin, BottomMargin, LeftMargin, RightMargin)

        Dim ShowDialog As Boolean = False 'True to show the Print dialog, false to not
        Dim FileName As String = _DocumentNumber 'Document name to show in the printer queue for this eDrawings file (see Remarks)
        Dim Shaded As Boolean = False 'True to print shaded, false to not print shaded
        Dim DraftQuality As Boolean = False 'True to print draft quality, false to print regular quality
        Dim Color As Boolean = False 'True to print in grayscale on black-and-white printers, false to print black and white (lines, edges, and text are black, and shaded data is grayscale)
        Dim printType As EMVPrintType 'Scale the eDrawings file as defined in EMVPrintType (see Remarks)
        Dim scale As Double 'Scaling factor; this argument is valid only when printType is set to eScaled
        Dim centerOffsetX As Integer 'Offset in thousands of an inch; this argument is valid only when printType is set to eScaled
        Dim centerOffsetY As Integer 'Offset in thousands of an inch; this argument is valid only when printType is set to eScaled
        Dim printAll As Boolean = False 'True to print all pages; false to not
        Dim pageFirst As Integer = 1 'Page number of first page to print
        Dim pageLast As Integer = 1 'Page number of last page to print

        Select Case _SheetSize
            Case "A4"
                printType = EModelView.EMVPrintType.eOneToOne
            Case "A3"
                If _PrinterSize = "A4" Then
                    printType = EModelView.EMVPrintType.eScaleToFit
                Else
                    printType = EModelView.EMVPrintType.eOneToOne
                End If
            Case "A2"
                If _PrinterSize = "A4" Then
                    printType = EModelView.EMVPrintType.eScaleToFit
                ElseIf InStr(_PrinterSize, "A3", CompareMethod.Text) > 0 Then
                    printType = EModelView.EMVPrintType.eScaleToFit
                Else
                    printType = EModelView.EMVPrintType.eOneToOne
                End If
            Case "A1"
                If _PrinterSize = "A4" Then
                    printType = EModelView.EMVPrintType.eScaleToFit
                ElseIf InStr(_PrinterSize, "A3", CompareMethod.Text) > 0 Then
                    printType = EModelView.EMVPrintType.eScaleToFit
                Else ' A1 Sheet on A1 Plotter
                    printType = EModelView.EMVPrintType.eOneToOne
                End If
        End Select

        If printType = EModelView.EMVPrintType.eScaled Then
            'scale = 2 'scale this
        End If

        AxEModelViewControl1.Print4(ShowDialog, FileName, Shaded, DraftQuality, Color, printType, scale, centerOffsetX, centerOffsetY, printAll, pageFirst, pageLast)
    End Sub

Open in new window

0
Comment
Question by:itpmore
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 1000 total points
ID: 34118898
Cant see anything in the code. What happens when you print them directly? Does it print with borders?
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question