PrintOut Method problem

Valued Contributor
Valued Contributor

HI,

Trying to print the draft in a letter paper size, and i'm leaving the scale blank cause if not specified the document is plotted at full scale. If a full-scale plot won't fit on the specified paper size, the document is scaled as needed to fit on the paper. As quoted from thge printOut Method of the SDK. But I keep getting an error , "Named argument expected...please help , I'm almost there!

 

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim objApplication As SolidEdgeFramework.Application = Nothing
        Dim objVal As Object = Nothing
        Dim objDraftDocument As SolidEdgeDraft.DraftDocument = Nothing

        Try
            ' Create/get the application with specific settings
            objApplication = Marshal.GetActiveObject("SolidEdge.Application")
            objDraftDocument = objApplication.ActiveDocument
            'Saves the draft document as pdf
            objDraftDocument.PrintOut("Microsoft XPS Document Writer", 1, 2,PaperSize:="Letter" ,  , , True , "c:\test.xps")

 

ST9
Conveyor and industrial equipment designer.
Giving SE a chance.
4 REPLIES

Re: PrintOut Method problem

Solution Partner Legend Solution Partner Legend
Solution Partner Legend

Hi,

 

PaperSize must be given a printer device dependent integer number not a string.

 

Kind regards,
Wolfgang Kunert - www.wksyspro.de

Re: PrintOut Method problem

Valued Contributor
Valued Contributor

OK, so I have to write it exactly like it's written in the printing properties of the printer?Or is there some sort of list.

ST9
Conveyor and industrial equipment designer.
Giving SE a chance.

Re: PrintOut Method problem

Valued Contributor
Valued Contributor

Ok, I got it it's only a number. Still can't get it to scale to the proper size so I can see everything on the pdf. See attached .jpeg, this is what I want to print as .pdf. It's bigger than the paper size.

The document is supposed to be scaled as needed if the parameter is left blank but I must be doing something wrong, please help.

Thanks!printthis.jpg

 

ST9
Conveyor and industrial equipment designer.
Giving SE a chance.

Re: PrintOut Method problem

Solution Partner Legend Solution Partner Legend
Solution Partner Legend

Hi,

 

are you printing the 2D sheet? I believe this prints fixed only in scale 1:1. You have to derive a 2D view from your 2D sheet on a standard sheet. If your sheet size has a size bigger than your printer sheet, then PrintOut will scale down to the given printer paper size.

 

Kind regards,
Wolfgang Kunert - www.wksyspro.de