Use BiPrint.dll from .NET Without Register Ocx File.

Document Imaging SDK,
Image SDK,
TIFF SDK,
Annotation SDK,
Cover Page Generator

Moderator: Technical Support Team

Use BiPrint.dll from .NET Without Register Ocx File.

Postby wectan » Thu Jun 24, 2010 3:32 am

Refer to TIFF C# DLL sample, we can using the DllImport to GetNumberOfImagesInTiffFile (BiTiff.dll), LoadTiffIntoDIB (BiTiff.dll), RotateDIB90 (BiDib.dll) and so on. However, there is not sample of printing like BiPrintSetup, PrepareToPrint, PrintDIBPage and so on.

I try the following thing below but get the error - Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

[DllImport("BiPrint.dll")]
public static extern int BiPrintSetup(string PrinterName, bool ShowDialog);
[DllImport("BiPrint.dll")]
public static extern short PrepareToPrint(int hwnd, string ImageName, short maxPage, short numCopies, bool DisplayNameAttribute, bool CenterVerticalImage, bool CenterHorizontalImage, bool ScalePage, bool ConvertCtoB, bool StretchPage, bool AllPage, bool UseDPI, bool NotDispCancel);

BiPrintSetup(printDialog.PrinterSettings.PrinterName, false);
PrepareToPrint(hwnd, _filename, maxPage, 1, false, true, true, true, false, false, false, false, false);


Do you have sample in C#.NET or Vb.NET like TIFF C++ Sample.exe that just using BIDIB.dll,BiDisp.dll, BiPrint.dll, BiTiff.dll and not using any ocx, AxInterop.BIPRINTLib.dll, Interop.BIPRINTLib.dll. We are required to implement these thing without required register ocx files.
wectan
 
Posts: 1
Joined: Thu Jun 24, 2010 2:53 am

Re: Use BiPrint.dll from .NET Without Register Ocx File.

Postby TechnicalSupportTeam » Wed Jun 30, 2010 8:45 am

Hello,

The PrepareToPrint function has different parameters you declared. Here is your definition:

[DllImport("BiPrint.dll")] public static extern short PrepareToPrint(
int hwnd,
string ImageName,
short maxPage,
short numCopies,
bool DisplayNameAttribute,
bool CenterVerticalImage,
bool CenterHorizontalImage,
bool ScalePage,
bool ConvertCtoB,
bool StretchPage,
bool AllPage,
bool UseDPI,
bool NotDispCancel);

You used the parameters of the PrepareToPrint method of the BiPrint.ocx. The parameter list of the PrepareToPrint function in the BiPrint.dll is different:

int CALLBACK PrepareToPrint(HWND hWnd, HDC hPrnDC, LPGPRINT lpPrint, LPSTR lpImgName, UINT nMaxPage);

If you want to use the BiPrint.dll you have to use the correct parameter list (including the GPRINT structure).
For more information about parameters please check the documentation or C++ sample. The C++ sample uses only the TIFF SDK dlls for printing so you can check the parameter lists in using.
TechnicalSupportTeam
 
Posts: 944
Joined: Sat Mar 20, 2004 11:50 am


Return to Imaging Toolkits



Who is online

Users browsing this forum: No registered users and 1 guest

cron