Kann mir jemand helfen diese C-Source nach PB umzuwandeln?
Komme leider nicht weiter. Bin dankbar für jede weitere Hilfe

MfG Falko
Hier der MSDN-Original-C-Source:
Code: Alles auswählen
Sending Data Directly to a Printer
It is sometimes necessary to bypass the driver and send printer-specific data directly to a printer. The following code shows how this can be done for both local and networked printers. This method can be used to replace the PASSTHROUGH escape and SpoolFile methods.
// RawDataToPrinter - sends binary data directly to a printer
//
// szPrinterName: NULL-terminated string specifying printer name
// lpData: Pointer to raw data bytes
// dwCount Length of lpData in bytes
//
// Returns: TRUE for success, FALSE for failure.
//
BOOL RawDataToPrinter(LPSTR szPrinterName, LPBYTE lpData, DWORD dwCount)
{
HANDLE hPrinter;
DOC_INFO_1 DocInfo;
DWORD dwJob;
DWORD dwBytesWritten;
// Need a handle to the printer.
if( ! OpenPrinter( szPrinterName, &hPrinter, NULL ) )
return FALSE;
// Fill in the structure with info about this "document."
DocInfo.pDocName = "My Document";
DocInfo.pOutputFile = NULL;
DocInfo.pDatatype = "RAW";
// Inform the spooler the document is beginning.
if( (dwJob = StartDocPrinter( hPrinter, 1, (LPSTR)&DocInfo )) == 0 )
{
ClosePrinter( hPrinter );
return FALSE;
}
// Start a page.
if( ! StartPagePrinter( hPrinter ) )
{
EndDocPrinter( hPrinter );
ClosePrinter( hPrinter );
return FALSE;
}
// Send the data to the printer.
if( !WritePrinter( hPrinter, lpData, dwCount, &dwBytesWritten ) )
{
EndPagePrinter( hPrinter );
EndDocPrinter( hPrinter );
ClosePrinter( hPrinter );
return FALSE;
}
// End the page.
if( ! EndPagePrinter( hPrinter ) )
{
EndDocPrinter( hPrinter );
ClosePrinter( hPrinter );
return FALSE;
}
// Inform the spooler that the document is ending.
if( ! EndDocPrinter( hPrinter ) )
{
ClosePrinter( hPrinter );
return FALSE;
}
// Tidy up the printer handle.
ClosePrinter( hPrinter );
// Check to see if correct number of bytes were written.
if( dwBytesWritten != dwCount )
return FALSE;
return TRUE;
}
Code: Alles auswählen
; RawDataToPrinter - sends binary Data directly To a printer
;
; szPrinterName: NULL-terminated string specifying printer name
; lpData: Pointer To raw Data bytes
; dwCount Length of lpData in bytes
;
; Returns: TRUE For success, FALSE For failure.
;
Procedure.b RawDataToPrinter(szPrinterName.s,lpData.b,dwCount.l)
hPrinter.l
DocInfo.DOC_INFO_1
dwJob.l
dwBytesWritten.l
; Need a handle To the printer.
If OpenPrinter_( szPrinterName, @hPrinter, 0)=0
ProcedureReturn #FALSE
EndIf
RAW.s="RAW"
MyDocument.s="My_Document"
; Fill in the Structure with info about this "document."
DocInfo\pDocName = @MyDocument
DocInfo\pOutputFile = 0
DocInfo\pDatatype = @RAW
; Inform the spooler the document is beginning.
dwJob=StartDocPrinter_( hPrinter, 1, @DocInfo )
If dwJob=0
ClosePrinter_( hPrinter )
ProcedureReturn #FALSE
EndIf
; Start a page.
If StartPagePrinter_( hPrinter ) = 0
EndDocPrinter_( hPrinter );
ClosePrinter_( hPrinter );
ProcedureReturn #FALSE
EndIf
; Send the Data To the printer.
If WritePrinter_( hPrinter, lpData, dwCount,@dwBytesWritten ) =0
EndPagePrinter_( hPrinter )
EndDocPrinter_( hPrinter )
ClosePrinter_( hPrinter )
ProcedureReturn #FALSE
EndIf
; End the page.
If EndPagePrinter_( hPrinter ) = 0
EndDocPrinter_( hPrinter )
ClosePrinter_( hPrinter )
ProcedureReturn #FALSE
EndIf
; Inform the spooler that the document is ending.
If EndDocPrinter_( hPrinter ) = 0
ClosePrinter_( hPrinter )
ProcedureReturn #FALSE
EndIf
; Tidy up the printer handle.
ClosePrinter_( hPrinter );
; Check To see If correct number of bytes were written.
If dwBytesWritten = dwCount
ProcedureReturn #FALSE
EndIf
EndProcedure
Drucker.s="EPSON Stylus COLOR 680"
OpenFile(0,"Grafik1.plt")
Anz.l=Eof(0)
For i=0 To Anz
Debug RawDataToPrinter(Drucker,ReadByte(),Anz)
Next i
CloseFile(0)