Print Page | Close Window

DEVMODE and PrintDocumentToFile

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2670
Printed Date: 17 Jan 26 at 11:10PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: DEVMODE and PrintDocumentToFile
Posted By: CBuilderJoe
Subject: DEVMODE and PrintDocumentToFile
Date Posted: 14 Jun 13 at 10:15AM
Hi All,

currently my program is written with C++Builder XE2 and uses the dll 9.12. All is working so far, but it seems as if the PrintDocumentToFile is somewhat broken in 9.14. The output of the same PDF is now 0 bytes instead of 11k. I did not change my code (except the header and dll version dependent things). What happend ??

The second is that SetPrinterDevModeFromString does not always work correctly. In some special cases - (eg. with Toshiba unversal printer driver V7.71), changing the DEVMODE settings have no effect or the PrintDocumentToFile does uses those settings.

best regards,
Bernd

Btw: who had that curly idea to pass the DEVMODE as a string ???




Replies:
Posted By: AndrewC
Date Posted: 14 Jun 13 at 12:18PM

I believe we have located and fixed the issue with PrintDocumentToFile generating a 0 byte file.  This will be included in the upcoming 9.15 Beta 3.

It seems that some printers don't use the DEVMODE structure as expected.   It seems some of the label printer drivers don't want to follow rules for DEVMODE.  Many drivers ignore the standard DEVMODE structure and store their settings in the extended DEVMODE header.

The DevMode string is actually an Delphi AnsiString and not a C++ string.  In Builder you should be able to pass a AnsiString to it or you may need to use the QPLBuffer functions if that doesn't work.

It is a string because the is the easiest way to pass a buffer to and from the DLL in Delphi and it is also possible to use these functions with other programming tools such as FoxPro, PowerBuilder, VB6 etc.  that don't have support for pointers.

Andrew.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk