SedraftX.ocx paramters?

[ Edited ]


I try use SedraftX.ocx (SE viewer V20) in a print batch, but I don't known some parameters. Do you have a list?

Is it possible to define a quality of images?


Thank you.


Best regards







Posted by: svaizo svaizo
Post date: 5/8/2011 11:44:54 PM


RE: SedraftX.ocx paramters?

[ Edited ]

Oleview.exe is the standard type library viewer for .dll, .tlb & .ocx. If you have it installed on your machine, you can directly look at the COM API declarations. To answer your question, I see two PrintOut methods defined and only one gives you any options, which are just number of copies. I would suggest that you read up on the CopyEMFToClipboard() method and find examples here in the forums. Once you have the EMF image data, you can do the printing yourself.


Posted by: Jason Newell
Post date: 5/9/2011 12:17:24 AM

RE: SedraftX.ocx paramters?

[ Edited ]

Thank you Jason!

Now I print .dft without open seviewer.


But quality is very low, I tried to set printer option, but not work well.


Do you have any ideas?


Posted by: svaizo svaizo
Post date: 5/9/2011 10:05:39 PM

RE: SedraftX.ocx paramters?

[ Edited ]

I hope i'm not to late


maybe this will help you this what i use some part of the code is proper to what i need


 Set objsheets = SEDraftX1.Sheets                For Each objsheet In objsheets                                                         Clipboard.Clear                                        AspectRatio = 1#                    BnWPrint = True 'Black and White                             Set device = Printer                    Call objsheet.CopyEMFToClipboard(AspectRatio, BnWPrint)                    sts = Clipboard.GetFormat(vbCFEMetafile)                    If (sts = True) Then                        Set PicObj = Clipboard.GetData(vbCFEMetafile)                        Printer.TrackDefault = True                        If Left(partname, 2) = "T3" Or Left(partname, 2) = "V3" Then                            device.PaperSize = vbPRPS10x14                        Else                            If IsNumeric(Right(Left(partname, 7), 1)) = False Then                                If UCase(Right(Left(partname, 8), 1)) <> "A" Then                                                 device.PaperSize = vbPRPS10x14                                 Else                                 device.PaperSize = vbPRPS11x17                                 End If                                                             Else                                device.PaperSize = vbPRPS11x17                            End If                        End If                                                                       If PicObj.Width > PicObj.height Then                        device.Orientation = vbPRORLandscape                        Else                        device.Orientation = vbPRORPortrait                        End If                        'Calculate the Left and Top margins (in TWIPS)                        LeftMargin = 1000                        TopMargin = LeftMargin                        'Calculate the actual drawing area on the page (in TWIPS)                        PaperWidth = device.Width - LeftMargin * 2                        PaperHeight = device.height - TopMargin * 2                        PicWidth = 567 * (PicObj.Width / 1000)                        PicHeight = 567 * (PicObj.height / 1000)                        PaperRatio = device.Width / device.height                        PicRatio = PicObj.Width / PicObj.height                        If (PaperRatio >= PicRatio) Then                            PaperWidth = PaperHeight * PicRatio                        Else                            PaperHeight = PaperWidth / PicRatio                        End If                        device.PrintQuality = 1                                          'Device.PaintPicture PicObj, LeftMargin, TopMargin, PaperWidth, PaperHeight, LeftMargin, 250                                                'Device.EndDoc                                                device.PaintPicture PicObj, LeftMargin, TopMargin, PaperWidth, PaperHeight, 0, 0, PicWidth, PicHeight                        device.EndDoc                        wait_printer                     End If                    cpt_sheets = cpt_sheets + 1                Next 


Posted by: Alex Gagnon
Post date: 7/21/2011 4:15:42 AM