Blog Post

Fine tuning the PDF Converter for SharePoint using STSADM commands

Clavin Fernandes
Illustration: Fine tuning the PDF Converter for SharePoint using STSADM commands

Wherever possible the PDF Converter for SharePoint uses a fancy SharePoint User Interface for specifying settings. However, some settings are so infrequently used that creating special screens for them just leads to confusion.

Instead we provide a number of ‘ stsadm’ commands to tweak these settings. This post lists all available settings. They all use the standard ‘ STSADM – o setproperty’ syntax. Please note that the value can be deleted by specifying nothing after the ‘-pv’ switch.

Please note that all these settings are global and apply to all Web Applications and Site Collections.

Alternative Check-in Behaviour (version 6.1.0.66+)

The default behaviour of the PDF Converter’s SharePoint front end is to always check-in files on document libraries that don’t explicitly require a check-out to be performed first, even when mandatory data is missing. If this is not desirable and you wish files with missing metadata to remain checked out then issue the following command on one of your farm’s SharePoint servers:

stsadm.exe -o setproperty -pn Muhimbi.SharePoint.DocumentConverter.PDF.CheckOutWhenRequiredFieldsEmpty -pv true

Skip certain fields when copying meta-data (version 6.1.0.66+)

The PDF Converter for SharePoint provides a number of facilities to copy metadata between files. Although we automatically skip certain fields, including calculated fields, some custom fields you may never want to copy. This very much depends on your own requirements, but suffice to say that you can specify a list of fields to ignore when copying metadata. For example the following command will make sure that the Title and User fields are never copied (unless explicitly listed in the Copy Metadata workflow activity, requires 7.0).

stsadm.exe -o setproperty -pn Muhimbi.SharePoint.DocumentConverter.PDF.SkipMetaDataFieldNames -pv Title;User

Always send PDF files to the Conversion Service (version 6.0.0.62+)

By default Muhimbi’s SharePoint front end software does not send any files that are already in PDF format to the conversion server. If you have written a custom converter that requires PDF files to be sent to the conversion server then execute the following command:

stsadm.exe -o setproperty -pn Muhimbi.SharePoint.DocumentConverter.PDF.SkipPDFFiles -pv false

Specify HTML Conversion delay for Personal Actions menu (version 8.4+)

Due to the way SharePoint internally renders web pages, the Muhimbi Web Page to PDF Converter waits 2 seconds between loading the page and converting it to PDF. This value can be tweaked using the following stsadm command (Values in milliseconds, so specify 5000 for 5 seconds).

stsadm.exe -o setproperty -pn Muhimbi.SharePoint.DocumentConverter.PDF.WebPageConversionDelay -pv 5000

PDF Converter in SharePoint Subscription Edition and the stsadm command

Wherever possible the PDF Converter for SharePoint On-Premises uses a SharePoint User Interface for specifying settings. However, some settings are so infrequently used that creating special screens for them just leads to confusion.

Instead we provide a number of ‘ stsadm’ commands to tweak these settings. Usually, these configurations are set by using the stsadm.exe command line tool included with SharePoint. For example:

stsadm.exe -o setproperty -pn Muhimbi.SharePoint.DocumentConverter.PDF.SkipMetaDataFieldNames -pv Title;User

Although the stsadm command line tool is not available in SharePoint Subscription Edition, there is an equivalent PowerShell script at our disposal.

The

stsadm -o setproperty -pn <property name> -pv <property value>

command can be substituted with the following PowerShell script

Add-PSSnapin Microsoft.SharePoint.PowerShell
$Farm = Get-SPFarm
$Farm.Properties["<property name>"] = "<property value>"
$Farm.Update()
$Farm.Dispose

The Update command is very important, otherwise the changes will not be stored.

If you are interested to learn more about available settings, you can read more in this post.

Author
Clavin Fernandes Developer Relations and Support Services

Clavin is a Microsoft Business Applications MVP who supports 1,000+ high-level enterprise customers with challenges related to PDF conversion in combination with SharePoint on-premises Office 365, Azure, Nintex, K2, and Power Platform mostly no-code solutions.

Explore related topics

Share post
Free trial Ready to get started?
Free trial