Paper.SheetSizeIndex doesn't work?

A forum for questions or concerns related to the PDF-XChange Core API SDK

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

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
sabio5
User
Posts: 16
Joined: Thu Apr 24, 2008 6:49 pm

Paper.SheetSizeIndex doesn't work?

Post by sabio5 »

After upgrading from version 5 to version 9 of the driver API, I can no longer set the paper size. My C code looks like this...

Code: Select all

 m_pPrinter->Option[L"Paper.SheetSizeIndex"] = L"0";   // set US Letter/ANSI A
I've tried other index values, and have also tried using just Paper.Size as suggested in some older forum posts. And I've tried setting the Paper.SheetWidth and Paper.SheetHeight properties directly, but no matter what, despite no errors being thrown, the result is A4.

On a related note, I can change the settings in the via the driver's preferences UI, but when I try to set them from my app, it always reverts to A4.

Thanks in advance,
Jack McGregor
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3549
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: Paper.SheetSizeIndex doesn't work?

Post by Ivan - Tracker Software »

In V9 possible values for Paper.SheetSizeIndex and Paper.Size was unified - standard paper index is used instead of paper index.

I.e., to set Letter as a Sheet, you will have to use 1 instead of 0.
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.
sabio5
User
Posts: 16
Joined: Thu Apr 24, 2008 6:49 pm

Re: Paper.SheetSizeIndex doesn't work?

Post by sabio5 »

This isn't working for me. I've verified that it is now using 1 rather than 0, and have also tried other index values such as 5, which would be either US Letter or ANSI E, depending on which index system was in effect, but no matter what value I specify, I get A4. Same goes for Paper.Size instead of Paper.SheetSizeIndex.

The only approach that seems to work is to just set the paper directly in the DEVMODE (as one would for standard Windows printing independent of PDFX), provided I don't use any Paper.SheetSizeIndex or Paper.Size directives. (They all seem to have the same effect of setting the size to A4.)

I suppose that's a workaround, but it would require a more complex adjustment to my app to maintain backward compatibility. Any other ideas?

Also, are there any other known changes to the interpretation of options that haven't been reflected in the documentation?

Thanks,
Jack
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3549
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: Paper.SheetSizeIndex doesn't work?

Post by Ivan - Tracker Software »

Hm, that's strange it does not work. I will double-check that.
Also, are there any other known changes to the interpretation of options that haven't been reflected in the documentation?
No, as I'm aware of.
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.
User avatar
Paul - Tracker Supp
Site Admin
Posts: 6813
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: Paper.SheetSizeIndex doesn't work?

Post by Paul - Tracker Supp »

Hi JAck,

Ivan is asking for the printer temp files. It should be the same process for you as for the end user as described here: https://www.pdf-xchange.com/knowle ... -I-do-this

If the files are too large for email please upload them to our file upload service as detailed here: https://www.pdf-xchange.com/knowle ... le-service

Please name them something eponymous and/or tell us the file names used so that we may associate it with this thread move it to a more suitable location.
Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
sabio5
User
Posts: 16
Joined: Thu Apr 24, 2008 6:49 pm

Re: Paper.SheetSizeIndex doesn't work?

Post by sabio5 »

Ok, here it is...
pxpSheetSizeIndex-155806.zip
(468.71 KiB) Downloaded 114 times
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3549
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: Paper.SheetSizeIndex doesn't work?

Post by Ivan - Tracker Software »

Thanks for the file, but I see no custom settings there.

Can you please send me a piece of code where you set printer options and start the printing process?

Please use ivan@tracker-software.com email.
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.
sabio5
User
Posts: 16
Joined: Thu Apr 24, 2008 6:49 pm

Re: Paper.SheetSizeIndex doesn't work?

Post by sabio5 »

I'm not quite sure how to provide you something you can actually use. The relevant code is basically identical (and indeed lifted from) the CExAPI sample. I have a wrapper class APDFX9 with a PreparePrinter routine ...

Code: Select all

BOOL APDFX9::PreparePrinter(PXC::IPXCPrinterPtr& printer, PXC::IPXCControlExPtr& pFactory, BOOL bNoEvents)
{
	if (printer == NULL)
	{
		printer = pFactory->Printer[(WCHAR*)L"", m_wchPrinterName, m_pKey, m_pDevCode];
		if (printer == NULL)
			return FALSE;
		if (!bNoEvents)
			DispEventAdvise(printer);
	}
	printer->ResetDefaults();
	...
	printer->Option[L"Paper.SheetSizeIndex"] = L"1";        
	printer->ApplyOptions(0);
I haven't gone through all of the possible printer options, but others that I've tried clearly work, such as Save.Path. And the code all worked in version 5, with the main update being to use the new pdfsaver.tlb that came with the V9 API.

Perhaps I can build a small one based on the CExAPI sample. But oddly, I can't get that sample program to work. It seems to be targeted at API V7, and fails on the init ...

Code: Select all

m_pFactory = PXC::IPXCControlExPtr(__uuidof(PXC::CPXCControlEx));
The pre-compiled versions also appear to have a similar problem (and do nothing when clicking Go).

Is there an updated sample specifically targeted at V9?
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3549
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: Paper.SheetSizeIndex doesn't work?

Post by Ivan - Tracker Software »

Looks like I can reproduce the issue on my side. Checking right now what may cause it
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.
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3549
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: Paper.SheetSizeIndex doesn't work?

Post by Ivan - Tracker Software »

I found the problem - it fails when there are no "Paper.StdSheetWidth" and "Paper.StdSheetHeight" are not specified.

I fix the issue, but it will be available in the next build.

As a workaround, you can specify

Code: Select all

printer->Option[L"Paper.SheetSizeIndex"] = -2; // Custom
printer->Option[L"Paper.StdSheetWidth"] = w; // width in tenth of mm; for example, 2100 for A4
printer->Option[L"Paper.StdSheetHeight"] = h; // height in tenth of mm; for example, 2970 for A4
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.
sabio5
User
Posts: 16
Joined: Thu Apr 24, 2008 6:49 pm

Re: Paper.SheetSizeIndex doesn't work?

Post by sabio5 »

Is that fix in 3.2.359? (I downloaded it but didn't see any version history notes.) And it doesn't seem to behave any differently in this respect. If it will be later, do you have an estimated time frame?

If I understand correctly, the workaround would require me to set up a table to convert the sheet size index values into the corresponding physical paper dimensions. That's do-able but seems a bit roundabout, especially if the fix is not far off.
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8371
Joined: Wed Jan 03, 2018 6:52 pm

Re: Paper.SheetSizeIndex doesn't work?

Post by TrackerSupp-Daniel »

Hello, sabio5

No, build 9.2.359.0 was released on November 23rd, before this came to light. The next release will be 360, and hopefully this fix can be implemented there. at the moment we do not have a timeline for when it will be ready, so I will have to ask for your patience in this matter.

Kind regards,
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Post Reply