Skip to main content
Participant
January 16, 2020
Answered

access 'Choose Papersource by PDF Page Size' option via code

  • January 16, 2020
  • 2 replies
  • 5018 views

Hello,

 

The screenshot in this post has a 'Choose Papersource by PDF Page Size" checkbox

https://helpx.adobe.com/acrobat/kb/print-mixed-page-sizes-acrobat.html

 

I was about to ask 'How can I control the state of that checkbox via Code or any other trick ?' and noticed a few similar posts about this subject with others having the same problem;

 

1-

https://community.adobe.com/t5/acrobat-reader/choose-paper-source-by-pdf-page-size/m-p/8808430#M19523

The suggestions and links in this article are useless, they point to a .NET based print approach (which is a rasterized method = bigger spool file and less quality) and do not use the far more efficient Acrobat Printing Infrastructure

 

2-

https://social.msdn.microsoft.com/Forums/vstudio/en-US/1a247bd6-81d6-422d-b617-890aa1190089/enable-choose-paper-source-by-pdf-page-size?forum=vbgeneral

 

https://social.msdn.microsoft.com/Forums/en-US/1ec5fb95-40fa-4414-a5a7-690600e62a09/how-to-programmatically-enable-option-quotchoose-paper-source-by-pdf-page-sizequot?forum=vbgeneral

 

same problem, unrelated info being given. None of the posts gives an answer to the choose source by pdf size question.

 

3-

I am familiar with Interapplication Communication API Reference from the Acrobat SDK.

The 'PrintPagesSilentEx does have a few good parameters, but it does not have an option for the mixed papersize. 

 

After a bit research the following works fine for me and is simple to implement from any platform. I am posting this to assist others that are stuck with this.

 

Access this Registry Key, adjust Acrobat Pro or Reader and Version according to your System

 

HKEY_CURRENT_USER\Software\Adobe\Adobe Acrobat\11.0\AVGeneral

HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\DC\AVGeneral

 

look for Key Value : bprintSetPageSize (DWORD)

Set to 0 : checkmark will be OFF when Acrobat is opened

Set to 1 : checkmark will be ON when Acrobat is opened

 

This registry hack will not work if you do this while Acrobat is opened (via code or manually) because Acrobat reads the Registry at startup once and caches the registry setting. Acrobat saves the last state set by the user into the registry during shutdown.

 

 

Correct answer Test Screen Name

This is neat but I feel it would be better to use a supported API. The JavaScript printparams object gives the ability to set most print-related options, including this one. The IAC API hasn’t been touched for maybe 20 years. 

2 replies

Participant
November 5, 2020

youuuuuuuuuuuuuuuuuuuuuuuuu are goooooooooooooooooooood

I had a hard time finding this. You're a genius.

Thank you very much!!!!!!!!!!!

Test Screen NameCorrect answer
Legend
January 16, 2020

This is neat but I feel it would be better to use a supported API. The JavaScript printparams object gives the ability to set most print-related options, including this one. The IAC API hasn’t been touched for maybe 20 years.