Here's some general printer stuff I made years ago for a userlib (its in C++) for Blitz+:-
//Printer DLL
//Written By Michael Denathorn 2005
//Sends text to the printer, also handle page breaks too
#include <windows.h>
#include <gdiplus.h>
#include <stdio.h>
using namespace Gdiplus;
//Globals
PRINTDLG pd;
DOCINFO di;
ULONG_PTR gdiToken;
#define BBDECL extern "C" _declspec(dllexport)
#define BBCALL _stdcall
BBDECL int BBCALL _DabzOpenPrinter(void)
{
GdiplusStartupInput gdiplusStartupInput;
GdiplusStartup(&gdiToken, &gdiplusStartupInput, NULL);
ZeroMemory(&di, sizeof(di));
di.cbSize = sizeof(di);
di.lpszDocName = "Dabz Printer Lib";
ZeroMemory(&pd, sizeof(pd));
pd.lStructSize = sizeof(pd);
pd.Flags = PD_RETURNDC;
if(!PrintDlg(&pd))
{
printf("Failure\n");
return(0);
}
return(1);
}
BBDECL int BBCALL _DabzStartDoc(void)
{
StartDoc(pd.hDC, &di);
return(1);
}
BBDECL int BBCALL _DabzStartPage(void)
{
StartPage(pd.hDC);
return(1);
}
BBDECL int BBCALL _DabzEndPage(void)
{
EndPage(pd.hDC);
return(1);
}
BBDECL int BBCALL _DabzEndDoc(void)
{
EndDoc(pd.hDC);
return(1);
}
BBDECL int BBCALL _DabzClosePrinter(void)
{
if(pd.hDevMode)
GlobalFree(pd.hDevMode);
if(pd.hDevNames)
GlobalFree(pd.hDevNames);
if(pd.hDC)
DeleteDC(pd.hDC);
GdiplusShutdown(gdiToken);
return(1);
}
BBDECL int BBCALL _DabzPrintText( const char *str, int posX, int posY)
{
TextOut(pd.hDC,posX,posY,str,strlen(str));
return(1);
}
Hope that helps in some way! :)
Dabz