Beiträge von VictorReinhart

    Hi,
    I tried using DrawBitmapFile, but it returns 0 and there is no picture on the output PDF.

    This happened for both my test Visual Basic and PowerBuilder programs.

    Maybe the problem is that I'm using the demo.

    If I purchase the product, will DrawBitmapFile work for "large" WMF files? For example, suppose there are 100 pages, will it work?

    If so, this would be a welcome alternative for printing datawindows to PDF. Currently, we use another product, which uses a Windows Printer Driver. This causes complications with permissions, Group Policies (user is not allowed to install a printer driver), and the ever-changing rules for printer drivers on each new OS.

    Thank you.

    I want to put a Windows Metafile into a PDF.

    Problem: my PowerBuilder code produces a PDF which is empty.

    Is there a return code from DrawMetaFile? If not, how do I know it worked?

    Any suggestion on API calls to load a Windows Metafile prior to calling DrawMetaFile?

    I used a PowerBuilder picture, similar to the Visual Basic example, but, unfortunately, the output PDF does not have the picture in it.

    Thank you.

    Victor

    Also, I found a workaround. The code was re-written to bypass the Active-X and use OLE instead:

    // This script works:

    Boolean lb_rc,lb_created
    Long ll_lic_code,ll_hjpg
    String ls_lic_name='LicenseName',ls_lic_key='LicenseCode'
    Int li_rc

    oleobject o_PDF

    o_PDF=CREATE oleobject
    li_rc=o_PDF.ConnectToNewObject('wPDF_X01.PDFControl')
    IF li_rc<>0 THEN
    MessageBox('Connect to wPDF'&
    ,'Connect to wPDF. Please install wPDF.',Exclamation!)
    RETURN -1
    END IF

    lb_created=TRUE

    lb_rc=o_pdf.StartEngine(is_pdf_dllname, "LicenseName", "LicenseCode",ll_lic_code)

    MessageBox('Start',lb_rc)

    IF lb_rc<> FALSE Then
    o_pdf.BeginDoc("c:\temp\atest6.pdf", 0)
    o_pdf.StartPage()
    o_pdf.Rectangle( 10, 10, 210, 100)
    o_pdf.TextOut( 50, 50, 'Hello THERE test 5!')
    // x,y,w,h,file
    ll_hjpg=o_pdf.DrawBitmapFile( 10, 300, 480, 532, 'c:\docs\docs\Palm Writing Guide.jpg')
    MessageBox('Draw JPG',ll_hjpg)
    // Return Value: 0=file not found.


    o_pdf.EndPage()
    o_pdf.EndDoc()
    o_pdf.StopEngine()
    End If

    IF IsValid(o_PDF) THEN
    IF lb_created THEN
    DESTROY o_PDF
    END IF
    END IF

    Hi,
    I am trying the wPDFControl Demo with PowerBuilder 8.0. The application uses the ActiveX control.

    The code works OK, and does create a PDF. However, when I close the window, it abends with:

    pb80.exe - Application Error
    The instruction at "0x01cbd3e8" referenced memory at "0x00000728". The memory could not be "read".

    Then, PowerBuilder crashes.

    Using Visual Basic 6.0, and a translated program, there is no crash (on the same PC).

    Here is my code:

    Boolean lb_rc
    Long ll_lic_code,ll_hjpg
    String ls_lic_name='LicenseName',ls_lic_key='LicenseCode'

    lb_rc=ole_pdf.Object.StartEngine(is_pdf_dllname, "LicenseName", "LicenseCode",ll_lic_code)

    MessageBox('Start',lb_rc)

    IF lb_rc<> FALSE Then
    ole_PDF.Object.BeginDoc("c:\temp\atest3.pdf", 0)
    ole_PDF.Object.StartPage()
    ole_PDF.Object.Rectangle( 10, 10, 210, 100)
    ole_PDF.Object.TextOut( 50, 50, 'Hello there')
    // x,y,w,h,file
    ll_hjpg=ole_PDF.Object.DrawBitmapFile( 10, 300, 480, 532, 'c:\docs\docs\Palm Writing Guide.jpg')
    MessageBox('Draw JPG',ll_hjpg)
    // Return Value: 0=file not found.

    ole_PDF.Object.EndPage()
    ole_PDF.Object.EndDoc()
    ole_PDF.Object.StopEngine()
    End If

    What can I do?

    Thank you.