Strange page sizing under Win7

PDF-XChange Drivers API (only) V4/V5
This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-XChange Printer Drivers SDK (only) - VERSION 4 & 5 - Please use the PDF-Tools SDK Forum for Library DLL assistance.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

Post Reply
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Strange page sizing under Win7

Post by anovy »

Hi,
I'm using the following C++ code to set page size:

LPDEVMODE dm=...
dm->dmFields=DM_PAPERSIZE|DM_PAPERLENGTH|DM_PAPERWIDTH;
dm->dmPaperSize=0;
dm->dmPaperLength=length;
dm->dmPaperWidth=width;
ResetDC(hdc,dm);

Under WinXP all works fine, however I found that under Win7 the maximal length or width value which can be entered is 29690 (i.e. 296,9 cm). If any value is higher, then ResetDC returns NULL and the given hdc is no more usable for printing. Do you know something about this issue and is it Win7 related or is it some problem in XChange?
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17901
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Strange page sizing under Win7

Post by Tracker Supp-Stefan »

Hi Anovy,

The limits should be 50800 - 508cm or 200 inches as detailed in the PDF specification - will ask the guys to have a look at this.

Best,
Stefan
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Re: Strange page sizing under Win7

Post by anovy »

Yes, I know this limit and under WinXP it works, but under Win7 I'm unable to achieve it. Or is there any other method how to set cutom page size in XChange?

BTW: The DeviceCapabilities(DC_MAXEXTENT) function returns for XChange these limits: 32767, 32767, i.e. 327,67 cm only. Not important for me, but generally you should return correct values.
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3549
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: Strange page sizing under Win7

Post by Ivan - Tracker Software »

BTW: The DeviceCapabilities(DC_MAXEXTENT) function returns for XChange these limits: 32767, 32767, i.e. 327,67 cm only. Not important for me, but generally you should return correct values.
By specification, driver fills max extend in DrvDeviceCapabilities function. It fills it in POINTS structure which has x, y as SHORT with range -32768 to 32767.
If any value is higher, then ResetDC returns NULL and the given hdc is no more usable for printing. Do you know something about this issue and is it Win7 related or is it some problem in XChange?
It is Windows 7 related (similar problem will be when large page size used together with high DPI).
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Re: Strange page sizing under Win7

Post by anovy »

By specification, driver fills max extend in DrvDeviceCapabilities function. It fills it in POINTS structure which has x, y as SHORT with range -32768 to 32767.
The dmPaperLength and dmPaperWidth in DEVMODE are also defined as SHORT, but in fact they are treated as WORD (at least in WinXP). Otherwise large paper sizes cannot be achieved (for example the max PDF size 200 inches).

It is Windows 7 related (similar problem will be when large page size used together with high DPI).
If so then this is horrible backward step in Win7. I cannot believe that modern OS in 21th century does not allow printing on a paper with a dimension larger than 3 m. Moreover the found limit is 29690 (not 32767), which sounds even more bizarre. Do you have some connection to Microsoft to ask them for this?
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Re: Strange page sizing under Win7

Post by anovy »

I also realized that the limit can depend on DPI (as you wrote). I used 1016 DPI, for the found limit 296,9 cm this implies 118760 points exactly (1016*296,9/2,54). I can look to this number as to the real limit, so if I will lower DPI, I can increase length. In either case 118760 points looks also as some foolish constant, I don't understand such limit.
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom
Contact:

Re: Strange page sizing under Win7

Post by John - Tracker Supp »

The issue appears to be with Windows 7 and we are in touch with Microsoft directly - we are now dependant on them - so please be patient and we will advise you of progress as it occurs, but I stress - we are reliant on them.

Thanks
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
User avatar
Paul - Tracker Supp
Site Admin
Posts: 6897
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: Strange page sizing under Win7

Post by Paul - Tracker Supp »

We are still waiting to hear from Microsoft. We have attempted to get an update but still have nothing from them. We will continue to push for a response. Our internal Ticket for this item is RT#586: problem printing to large paper size on Win7

Your patience is still appreciated.
Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom
Contact:

Re: Strange page sizing under Win7

Post by John - Tracker Supp »

Pls note that we have now sent MS 4 emails and called on 4 occassions and have received read receipts for emails - buit still no worthtwhile response ...

Please feel fee to also contact them using the ticket info you supplied and we also were advised to use (by MS) - maybe 2 direct contacts chasing will prove more successful.

Thanks
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
User avatar
Paul - Tracker Supp
Site Admin
Posts: 6897
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: Strange page sizing under Win7

Post by Paul - Tracker Supp »

Eventually, despite no response from Microsoft, we (thanks here goes to Roman actually...) found this: http://support.microsoft.com/kb/2011767 so there is now a KB article about it on our site: https://www.pdf-xchange.com/knowled ... -Windows-7

The latter is essentially just a reference to the former. It has worked for others, if anyone has problems implementing this fix to Windows 7 please do let us know.

Case closed... ;-)
Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
Post Reply