Printing twice with PDF CreativeX component

If you are a VB developer and have questions about using our products from VB, here is the place to post them.
Post Reply
Rod
Posts: 3
Joined: Wed Jul 02 2003

Printing twice with PDF CreativeX component

Post by Rod »

Hi,
I cannot print twice using this active X

Here is a Code sample:

Private Sub Command1_Click()

Me.PDFCreactiveX1.Open "C:\test\TransactionRPT.pdf", ""
Call Me.PDFCreactiveX1.Print("", False)
Call Me.PDFCreactiveX1.Print("", False)

End Sub

On second call, it failed giving me this message:
Runtime error '-2147467259 (80004005)': Method 'Print' of object 'IPDFCreativeX' failed

Is there a way to reset it, I try method initblank... but still giving me error
Thanks for the hint

Rod Custeau
Jose
Amyuni Team
Posts: 553
Joined: Tue Oct 01 2002
Contact:

Post by Jose »

Hi,

To multiple copies of a PDF docuent you can use the following code:

Me.PDFCreactiveX1.Open "C:\test\TransactionRPT.pdf", ""
Call Me.PDFCreactiveX1.Copies(Copies)
Call Me.PDFCreactiveX1.Print("", False)

Copies = Number of copies to print document
Rod
Posts: 3
Joined: Wed Jul 02 2003

Post by Rod »

Well,
It's a property, not a parameter:
With your code it give me an Invalid use of property.

It's better this way :

Code: Select all

Me.PDFCreactiveX1.Copies = 2
But, prints only once, and I still can't do what I want:

Imagine I'm looping through a recordset to print all the transaction that occured on an Item to print them in batch: Here is a code Sample. If there is no pdf for this transaction we print the current report. Look in the else part of the if...

Code: Select all

    ' Ask for printing in batch
    vbAnswer = MsgBox(GetSysMessage(670), vbYesNo + vbDefaultButton2 + vbQuestion, GetSysMessage(2033))
    If vbAnswer = vbYes Then
        ' for each record
        Me.SubmissionItemTransSubf.Form.RecordsetClone.MoveFirst
        Do Until Me.SubmissionItemTransSubf.Form.RecordsetClone.EOF
            If LoadPDF(Me.SubmissionItemTransSubf.Form.RecordsetClone!TRANSACTIONID) = 0 Then

                GetDefaultRptTransac Me.SubmissionItemTransSubf.Form.RecordsetClone!TYPE, strRptName, strLabel
    sngStep = 3
                strCondition = "TransactionID = " & Me.SubmissionItemTransSubf.Form.RecordsetClone!TRANSACTIONID
                intReturn = PrintReport(strRptName, acNormal, "", strCondition, 1)
                strCondition = ""
            Else
                Me.objPDF.OpenPDF gstrCurrentBARDERPDir & "\Temp\TransactionRpt.pdf", ""
                Me.objPDF.PrintPDF "", False
            End If
            Me.SubmissionItemTransSubf.Form.RecordsetClone.MoveNext
        Loop
    End If
Can I have an old release of the control ?

Thanks
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hi Rod,

Which version of the PDF Creator are you currently using?

It is difficult to get an older version of the control, but maybe a newer version may help.

Thanks.
Rod
Posts: 3
Joined: Wed Jul 02 2003

Post by Rod »

Hi Joan,

I realized that I didn't have the newest version of your pdfcreactivex.dll.
I tried with the version 1.0.9.6 and It seems working pretty well now.
So, The problem seems to be corrected with this release.

Thanks a lot for your support!

Rod
Post Reply