PrintPage 3.x

The PDF Creator enables you to create secure PDF documents and to view, print and process existing PDF documents.
If you have any questions about the installation and usage of the PDF Creator please post them here.
Post Reply
Giuseppe Ferlisi
Posts: 22
Joined: Thu Oct 03 2002
Location: Germany

PrintPage 3.x

Post by Giuseppe Ferlisi » Mon Oct 22 2007

Hi,

after update the Creator vom 2.x to 3.x we get a error while printing. We print diferent pages from diferent files to one printqeue.

For i = 1 To 100

dim x() as Byte
x = BinaryPDFImage

Dim nLow As Long[/code][/code]
Dim cbMem As Long
Dim hMem As Long
Dim lpMem As Long
Dim istm As stdole.IUnknown ' IStream

' Get the size
On Error GoTo out
nLow = LBound(x)
On Error GoTo 0
cbMem = (UBound(x) - nLow) + 1

' Allocate a global memory object
hMem = GlobalAlloc(GMEM_MOVEABLE, cbMem)
If hMem Then
' Lock the memory object and get a pointer to it.
lpMem = GlobalLock(hMem)
If lpMem Then
' Copy to the memory and unlock the handle.
MoveMemory ByVal lpMem, x(nLow), cbMem
Call GlobalUnlock(hMem)
If (CreateStreamOnHGlobal(hMem, CTrue, istm) <> S_OK) Then
End If ' CreateStreamOnHGlobal
End If ' lpMem
End If ' hMem

Dim pdfStream As IPersistStreamInit
Set pdfStream = PDFCreactiveX1

'Load stream into object
pdfStream.Load istm
PDFCreactiveX1.Refresh
Call GlobalFree(hMem)
Set pdfStream = Nothing

PDFCreactiveX1.ObjectAttributeStr "Document", "DuplexPrinting", "1"
PDFCreactiveX1.ObjectAttributeStr "Document", "Title", "TEST"
PDFCreactiveX1.ObjectAttributeStr "Pages[1]", "PaperBin", 15

PDFCreactiveX1.PrintPage 1
PDFCreactiveX1.ClearPage 1

Next

PDFCreactiveX1.EndPrint

Post Reply