Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

How to hide the Save dialog box when printing with eprint 5
Started by mahendra at 11-12-2008 6:57. Topic has 3 replies.

Print Search « Previous Thread Next Thread »
  11-12-2008, 6:57
mahendra is not online. Last active: 11/4/2008 10:45:25 AM mahendra

Top 150 Posts
Joined on 09-30-2008
Posts 19
How to hide the Save dialog box when printing with eprint 5
Reply Quote

Hi

I am converting the HTML document to JPEG image through eprint 5.

ePrintV5.StartDocumentConversion PUBLICS_IMAGING.pIMAGE_PRINT_DRIVER, 0
wb.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, 0, 0
ePrintV51.EndDocumentConversion PUBLICS_IMAGING.pIMAGE_PRINT_DRIVER, 0

I have wrriten the following code and using web browser control of VB to open the HTML page then giving its print option. but everytime a save dialog box is coming..i want to hide it and by pass it..is there any way so that I can hide this save dialog box.

Please assist asap.

Thanks

Mahendra

 


   Report 
  11-12-2008, 10:14
Yasir Alani is not online. Last active: 11/16/2008 11:29:23 AM Yasir Alani



Top 10 Posts
Joined on 02-05-2007
Posts 311
Re: How to hide the Save dialog box when printing with eprint 5
Reply Quote
Mahendra,

You should be able to do this by creating a Task Printer that will save in the format that you want (JPEG in your case). The settings will be hard coded and no dialogs should appear to the user.

For more details and an example code, please see the help topic "AddPrinter (IEPrint) Example for Visual Basic" in the LEADTOOLS ePrint 5 COM Object Help file.
Yasir Alani
LEADTOOLS Technical Support
support@leadtools.com
   Report 
  11-13-2008, 8:33
mahendra is not online. Last active: 11/4/2008 10:45:25 AM mahendra

Top 150 Posts
Joined on 09-30-2008
Posts 19
Re: How to hide the Save dialog box when printing with eprint 5
Reply Quote

I was trying to create a task printer. but it was giving me error to add a printer.

ePrintV51.AddPrinter PUBLICS_IMAGING.pIMAGE_PRINT_DRIVER, PRINTER_TASK

'PUBLICS_IMAGING.pIMAGE_PRINT_DRIVER = "Leadtools Eprint 5"

----------------------------------------------------------------------------------

Currently I am having this code

When ever I am debugging the code Image is getting generated and code is also working fine. But this not the case when I am executing directly and one SAVE AS dialog box is opening up which I have attached as Image.

    Dim ePrintV51 As EPrint
    Dim PrinterSaveOptions1 As EpnPrinterSaveOptions
    Dim MultiSaveOptions1 As EpnMultiSaveOptions
    Dim ExtraDcOptions1 As EpnExtraDcOptions
    Dim HDC1 As Long
    Dim nRet As Integer
    Dim strDestFileName As String

    PUBLICS_SET_PRINTER.ChangeDefaultPrinter PUBLICS_IMAGING.pIMAGE_PRINT_DRIVER
    ''PUBLICS_IMAGING.pIMAGE_PRINT_DRIVER is a "Leadtools Eprint 5"
    DoEvents

    Set ePrintV51 = New EPrint
    Set PrinterSaveOptions1 = New EpnPrinterSaveOptions
    Set MultiSaveOptions1 = New EpnMultiSaveOptions
    Set ExtraDcOptions1 = New EpnExtraDcOptions
   
    If ePrintV51.IsSupportLocked(LPEPCLib.SupportLockConstants.SUPPORT_EVAL) Then
        ePrintV51.UnlockSupport LPEPCLib.SupportLockConstants.SUPPORT_EVAL, ""
    End If

    strDestFileName = mFILE_TEMP_PATH & CStr(mlngLeadNmbr) & "-" & mFILE_TEMP_NAME & ".JPG"
    nRet = ePrintV51.GetPrinterSaveOptions(PUBLICS_IMAGING.pIMAGE_PRINT_DRIVER, MultiSaveOptions1)
    MultiSaveOptions1.UseSave = True
    MultiSaveOptions1.SaveElementsCount = 1
    MultiSaveOptions1.PrinterSaveOptions(0).SaveOptions.FileName = strDestFileName
    MultiSaveOptions1.PrinterSaveOptions(0).SaveOptions.Format = FILE_JPEG
    MultiSaveOptions1.PrinterSaveOptions(0).SaveOptions.DocumentType = FT_SAVE_TYPE_RASTER
    MultiSaveOptions1.PrinterSaveOptions(0).SaveOptions.RasterOptions.BITSPERPIXEL = 24
    MultiSaveOptions1.PrinterSaveOptions(0).SaveOptions.RasterOptions.QFactor = 100
    MultiSaveOptions1.PrinterSaveOptions(0).SaveOptions.RasterOptions.StampBits = 24
    MultiSaveOptions1.PrinterSaveOptions(0).SaveOptions.RasterOptions.StampWidth = 128
    MultiSaveOptions1.PrinterSaveOptions(0).SaveOptions.RasterOptions.StampHeight = 128
    MultiSaveOptions1.PrinterSaveOptions(0).SaveOptions.RasterOptions.MultiPageFile = False
    MultiSaveOptions1.PrinterSaveOptions(0).Flags = 0
   

    Set PrinterSaveOptions1 = MultiSaveOptions1.PrinterSaveOptions(0)
    nRet = ePrintV51.SetPrinterSaveOptions(PUBLICS_IMAGING.pIMAGE_PRINT_DRIVER, MultiSaveOptions1)

    HDC1 = ePrintV51.CreateSaveDC(PUBLICS_IMAGING.pIMAGE_PRINT_DRIVER, Nothing, PrinterSaveOptions1, ExtraDcOptions1)


    If (HDC1 <> 0) Then
        ePrintV51.StartDocumentConversion PUBLICS_IMAGING.pIMAGE_PRINT_DRIVER, 0
        wb.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, 0, 0
       
'Here I am getting the SAVE as dialog box in run mode..
        'strange is that in dubug mode it is not coming and image is getting saved as per code.
       
        ePrintV51.EndDocumentConversion PUBLICS_IMAGING.pIMAGE_PRINT_DRIVER, 0
    End If

Please tell me why this save as dialog box is coming while same code is working for other objects like word/Excel. But with web browser its coming in execution mode.


   Report 
  11-13-2008, 10:21
mahendra is not online. Last active: 11/4/2008 10:45:25 AM mahendra

Top 150 Posts
Joined on 09-30-2008
Posts 19
Re: How to hide the Save dialog box when printing with eprint 5
Reply Quote

Hi

Thanks to  Leadtools Support Team..

Finally I got the resolution for trhe same.

       ePrintV51.StartDocumentConversion PUBLICS_IMAGING.pIMAGE_PRINT_DRIVER, 0
       ' wb.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, 0, 0

        wb.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, -1, -1

        'Here I am getting the SAVE as dialog box in run mode..
        'strange is that in dubug mode it is not coming and image is getting saved as per code.
       
        ePrintV51.EndDocumentConversion PUBLICS_IMAGING.pIMAGE_PRINT_DRIVER, 0

After passsing the -1 in place of 0 save as Dialog is disabled. and I mage is getting generated properly.

Thanks

Mahendra Namdeo

 


   Report 
Post
LEAD Support Fo... » Enduser » ePrint » How to hide the Save dialog box when printing with eprint 5

Powered by Community Server, by Telligent Systems