Announcement

Collapse
No announcement yet.

ProwerJS Print HTML ActiveX DLL not printing

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Steven Pringels 3
    replied
    The following code does the trick for me

    There is inconsistency with the usage of UCODE with that ActiveX control.
    Nothing to do with PB itself.

    Code:
    #COMPILE EXE
    #DIM ALL
    #INCLUDE "PrintJS.inc"
    
    FUNCTION PBMAIN () AS LONG
    LOCAL PJS AS IDISPATCH
    LOCAL parm AS VARIANT
        PJS = NEWCOM $PROGID_PowerJS_clsPrintHTMLclsPrintHTML
        IF ISFALSE(ISOBJECT(PJS)) THEN EXIT FUNCTION
    
        parm = UCODE$("My Company/010101010101010")
        OBJECT LET PJS.LicenseKey = parm
        parm = UCODE$("Jaws PDF Creator") :
        OBJECT LET PJS.PrinterName = parm
        parm = 1 : OBJECT LET PJS.Orientation = parm
        parm = UCODE$("My Header") : OBJECT LET PJS.Header = parm
        parm = UCODE$("&p of &P") : OBJECT LET PJS.Footer = parm
        parm = -1 : OBJECT LET PJS.BackGround = parm
        parm = 1  : OBJECT LET PJS.LeftMargin = parm
        parm = 1  : OBJECT LET PJS.TopMargin = parm
        parm = 1  : OBJECT LET PJS.RightMargin = parm
        parm = 1  : OBJECT LET PJS.ButtomMargin = parm
        'Parm = Ucode$("Jaws PDF Creator")
        'Object Let PJS.PrinterName = Parm
        parm = "D:\Program Files\PowerJS PrintHTML ActiveX for Windows\VAR_DUT.HTML"
        OBJECT LET PJS.PrintURL = parm
        'MsgBox Buffer
        'Parm = Buffer
        'Object Let PJS.PrintString = Parm
        parm = 1  : OBJECT LET PJS.Copies = parm
        OBJECT CALL PJS.PrintHTML
    
    END FUNCTION

    Leave a comment:


  • Erich Schulman
    replied
    This variation also does not work.

    Code:
        parm = "My Company/010101010101010" AS STRING : OBJECT LET PJS.LicenseKey = parm
        parm = "HP Color LaserJet 5500 PCL 6" AS STRING : OBJECT LET PJS.PrinterName = parm
        parm = 2 AS LONG : OBJECT LET PJS.Orientation = parm
        parm = "My Header" AS STRING : OBJECT LET PJS.Header = parm
        parm = "&p of &P" AS STRING : OBJECT LET PJS.Footer = parm
        parm = -1 AS LONG : OBJECT LET PJS.BackGround = parm
        parm = 1  AS LONG : OBJECT LET PJS.LeftMargin = parm
        parm = 1  AS LONG : OBJECT LET PJS.TopMargin = parm
        parm = 1  AS LONG : OBJECT LET PJS.RightMargin = parm
        parm = 1  AS LONG : OBJECT LET PJS.ButtomMargin = parm
        parm = "http://www.yahoo.com/" AS STRING : OBJECT LET PJS.PrintURL = parm
        parm = 2 AS LONG : OBJECT LET PJS.Copies = parm
        OBJECT CALL PJS.PrintHTML

    Leave a comment:


  • Erich Schulman
    replied
    I have tried with and without UCODE$. I tried a different virtual printer, and I tried a real printer as well. Nothing ever reaches a printer, and I am not sure anything even reaches the Windows printing subsystem.

    Leave a comment:


  • Michael Mattias
    replied
    >parm = UCODE$("My Company/010101010101010")

    When assigning a string variable or string expression to a variant....
    LET vrntvar = expression [AS vartype]

    The numeric or string expression is evaluated, and the result is assigned to the variant variable.....In the case of a string value, PowerBASIC automatically handles Unicode conversions needed for the COM specification
    Methinks thou dost be UCODE-ing that which hath already been UCODE-ed.

    MCM

    Leave a comment:


  • ProwerJS Print HTML ActiveX DLL not printing

    The library is available at http://www.powerjs.com/index.aspx

    My code:
    Code:
    #COMPILE EXE
    #DIM ALL
    #INCLUDE "PrintHTML.inc"
    
    FUNCTION PBMAIN () AS LONG
    LOCAL PJS AS IDISPATCH
    LOCAL parm AS VARIANT
    
        PJS = NEWCOM $PROGID_PowerJS_clsPrintHTMLclsPrintHTML
        IF ISFALSE(ISOBJECT(PJS)) THEN EXIT FUNCTION
        
        parm = UCODE$("My Company/010101010101010") : OBJECT LET PJS.LicenseKey = parm
        parm = UCODE$("PDFCreator") : OBJECT LET PJS.PrinterName = parm
        parm = 2 : OBJECT LET PJS.Orientation = parm
        parm = UCODE$("My Header") : OBJECT LET PJS.Header = parm
        parm = UCODE$("&p of &P") : OBJECT LET PJS.Footer = parm
        parm = -1 : OBJECT LET PJS.BackGround = parm
        parm = 1  : OBJECT LET PJS.LeftMargin = parm
        parm = 1  : OBJECT LET PJS.TopMargin = parm
        parm = 1  : OBJECT LET PJS.RightMargin = parm
        parm = 1  : OBJECT LET PJS.ButtomMargin = parm
        parm = UCODE$("http://www.powerjs.com") : OBJECT LET PJS.PrintURL = parm
        parm = 2  : OBJECT LET PJS.Copies = parm
        OBJECT CALL PJS.PrintHTML
    
    END FUNCTION
    The Test method works fine. But if I try to really print, an error message flashes so fast I have no chance of reading any of it.

    I am using IE8 in XP(32) SP3.
Working...
X