VMware Horizon Community
amarsden
Contributor
Contributor

Warning - UEM and File Type Associations - PDFs don't play nice

OK - background

We have a program that uses code to create a document in PDF format then send it straight to print.  It does this by calling the default Adobe Reader in the background.

It failed.  It generated an "error 31"  a quick Google will show a few results that indicate that the program couldn't find the a program to open the PDF with - or to be exact - to PRINT it with.

PDF files opened fine when double clicked.

Long Story Short.  We had use UEM File Type Associations to set PDFs to Acrobat Reader as we had some users who have Nitro Pro.

When this method is used it adds settings to the User's Classes part of the registry in the "default" Windows way - so the same as if you manually set a default .XXX file to open with, say Notepad.  You get a .XXX section and a XXX_AUTO_RUN section - so for PDFs you get

[HKEY_USERS\S-1-5-21-3546700700-2859058569-1453736124-22891_Classes\.pdf]

@="pdf_auto_file"

[HKEY_USERS\S-1-5-21-3546700700-2859058569-1453736124-22891_Classes\pdf_auto_file]

[HKEY_USERS\S-1-5-21-3546700700-2859058569-1453736124-22891_Classes\pdf_auto_file\DefaultIcon]

@="C:\\Program Files\\Adobe\\Acrobat Reader DC\\Reader\\AcroRd32.exe,0"

[HKEY_USERS\S-1-5-21-3546700700-2859058569-1453736124-22891_Classes\pdf_auto_file\Shell]

[HKEY_USERS\S-1-5-21-3546700700-2859058569-1453736124-22891_Classes\pdf_auto_file\Shell\Open]

[HKEY_USERS\S-1-5-21-3546700700-2859058569-1453736124-22891_Classes\pdf_auto_file\Shell\Open\Command]

@="\"C:\\Program Files\\Adobe\\Acrobat Reader DC\\Reader\\AcroRd32.exe\" \"%1\""

(that's exported for Regedit when run as a different account)

This is enough for simple associations - double clicking a file.  But not for when yo call Acrobat Reader programmatically to print.

This is what Adobe adds to classes by default - a LOT more - shown in HKEY_Classes_ROOT - which I believe is generated from user settings, but easier to read.

[HKEY_CLASSES_ROOT\.pdf]

@="AcroExch.Document.11"

"Content Type"="application/pdf"HKE

Y_CLASSES_ROOT\.pdf\OpenWithList]

@=""H

HKEY_CLASSES_ROOT\.pdf\OpenWithList\AcroRd32.exe]

@=""

[HKEY_CLASSES_ROOT\.pdf\OpenWithList\pdfsam.exe]

@=""

[HKEY_CLASSES_ROOT\.pdf\OpenWithList\winword.exe]

@=""

[HKEY_CLASSES_ROOT\.pdf\OpenWithProgids]

"PDFsamBasic.FileAssoc.Pdf"=""

HKEY_CLASSES_ROOT\.pdf\PersistentHandler]

@="{F6594A6D-D57F-4EFD-B2C3-DCD9779E382E}"

[HKEY_CLASSES_ROOT\.pdf\ShellEx]

[HKEY_CLASSES_ROOT\.pdf\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}]

@="{DC6EFB56-9CFA-464D-8880-44885D7DC193}"

[HKEY_CLASSES_ROOT\AcroExch.Document.11]

@="Adobe Acrobat Document"

"EditFlags"=hex:00,00,01,00

"BrowseInPlace"="1"

[HKEY_CLASSES_ROOT\AcroExch.Document.11\CLSID]

@="{B801CA65-A1FC-11D0-85AD-444553540000}"

[HKEY_CLASSES_ROOT\AcroExch.Document.11\DefaultIcon]

@="C:\\Windows\\Installer\\{AC76BA86-7AD7-FFFF-7B44-AB0000000001}\\PDFFile_8.ico,0"

[HKEY_CLASSES_ROOT\AcroExch.Document.11\Insertable]

@=""

[HKEY_CLASSES_ROOT\AcroExch.Document.11\protocol]

[HKEY_CLASSES_ROOT\AcroExch.Document.11\protocol\StdFileEditing]

[HKEY_CLASSES_ROOT\AcroExch.Document.11\protocol\StdFileEditing\RequestDataFormats]

@="NoteshNote"

[HKEY_CLASSES_ROOT\AcroExch.Document.11\protocol\StdFileEditing\server]

@="\"C:\\Program Files\\Adobe\\Reader 11.0\\Reader\\AcroRd32.exe\""

[HKEY_CLASSES_ROOT\AcroExch.Document.11\protocol\StdFileEditing\SetDataFormats]

@="NotesDocInfo"

[HKEY_CLASSES_ROOT\AcroExch.Document.11\protocol\StdFileEditing\verb]

[HKEY_CLASSES_ROOT\AcroExch.Document.11\protocol\StdFileEditing\verb\0]

@="&Open"

[HKEY_CLASSES_ROOT\AcroExch.Document.11\shell]

@="Read"

[HKEY_CLASSES_ROOT\AcroExch.Document.11\shell\Open]

[HKEY_CLASSES_ROOT\AcroExch.Document.11\shell\Open\command]

@="\"C:\\Program Files\\Adobe\\Reader 11.0\\Reader\\AcroRd32.exe\" \"%1\""

[HKEY_CLASSES_ROOT\AcroExch.Document.11\shell\Print]

[HKEY_CLASSES_ROOT\AcroExch.Document.11\shell\Print\command]

@="\"C:\\Program Files\\Adobe\\Reader 11.0\\Reader\\AcroRd32.exe\" /p /h \"%1\""

[HKEY_CLASSES_ROOT\AcroExch.Document.11\shell\Printto]

[HKEY_CLASSES_ROOT\AcroExch.Document.11\shell\Printto\command]

@="\"C:\\Program Files\\Adobe\\Reader 11.0\\Reader\\AcroRd32.exe\" /t \"%1\" \"%2\" \"%3\" \"%4\""

[HKEY_CLASSES_ROOT\AcroExch.Document.11\shell\Read]

@="Open with Adobe Reader XI"

[HKEY_CLASSES_ROOT\AcroExch.Document.11\shell\Read\command]

@="\"C:\\Program Files\\Adobe\\Reader 11.0\\Reader\\AcroRd32.exe\" \"%1\""

[HKEY_CLASSES_ROOT\AcroExch.Document.11\Shellex]

[HKEY_CLASSES_ROOT\AcroExch.Document.11\Shellex\PropertySheetHandlers]

@="InfoPage"

[HKEY_CLASSES_ROOT\AcroExch.Document.11\Shellex\PropertySheetHandlers\InfoPage]

@="{F9DB5320-233E-11D1-9F84-707F02C10627}"

[HKEY_CLASSES_ROOT\AcroExch.Document.11\Shellex\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}]

@="{F9DB5320-233E-11D1-9F84-707F02C10627}"

Note: The .pdf section links to the AcroExch.Document.11 section, rather than a default pdf_auto_run section, this is Adobe's way of allowing different Readers to co-exist (I think)

I think these Print - and PrintTo (line 48, 50, 51) sections are what was breaking our Program.

Now, the User classes section seems to survive a reboot AND the deletion of the UEM Profile - so must be stored separately (can anyone help us identify where?) - so I having to manuallly delete these from user profiles, as when they are in this section they stay in for good.

Anyway, that's my interpretation of what caused me a many days of frustration!

Cheers

ACM

Reply
0 Kudos
1 Reply
HartmutEhl
Enthusiast
Enthusiast

Hi,

I would guess that you find your keys in HKLM\Software\Classes for the machine

and HKCU\Software\Classes\Applications for user settings

The root key exists for compatibility reasons, according to M$

hth, regards Hartmut

Reply
0 Kudos