Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, November 12, 2008 1:52:29 AM(UTC)
mahendra

Groups: Registered
Posts: 10


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

 

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Wednesday, November 12, 2008 5:09:05 AM(UTC)

Yasir Alani  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

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.
 
#3 Posted : Thursday, November 13, 2008 3:28:34 AM(UTC)
mahendra

Groups: Registered
Posts: 10


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.

 
#4 Posted : Thursday, November 13, 2008 5:16:32 AM(UTC)
mahendra

Groups: Registered
Posts: 10


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

 

 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.106 seconds.