How Can I specify which Infopath View to convert from my own code

The Muhimbi PDF Converter comes with extensive View selection facilities for InfoPath forms. These facilities are relatively easy to use, but when you work directly with our Web Services interface it may not be immediately clear how to specify the view name. (See Developer Guide)

This Knowledge Base article describes how to create a Web Services example that allows a specific conversion view to be selected. This sample uses C#, but the code is almost identical in other environments such as Java.


Start by creating the example in this blog post and make sure it works without error when the InfoPath XML file is passed in.

Then add some logic to specify which view to convert. After the following line:

conversionSettings.Quality = ConversionQuality.OptimizeForPrint;

add the following code and replace "Your View Name" with the name of the view you wish to convert.

ConverterSpecificSettings_InfoPath css = new ConverterSpecificSettings_InfoPath();
css.AutoTrustForms = false;
css.ConvertAttachments = true;
css.ProcessFullTrustForms = true;
css.StripDataObjects = true;
css.StripDotNETCode = true;
css.ConversionViews = new InfoPathView[1];
css.ConversionViews[0] = new InfoPathView();
css.ConversionViews[0].Name = "Your View Name";
conversionSettings.ConverterSpecificSettings = css;


That is all there is to it.

Note that you can add multiple InfoPathView objects to convert and merge multiple views in a single operation.

Have more questions? Submit a request


Please sign in to leave a comment.