Although we succeeded in making it compatible, we recently found out that when using the standard version of the aging Visual Studio 2005 environment, there are some problems with the XML serialisation of web service data.
This article explains how to invoke the Muhimbi PDF Converter API and Server Platform from a Visual Studio 2005 environment. It also provides a VB version of the C# based sample code used in our main Web Services tutorial. If you use Visual Studio 2008 or newer then please use this tutorial, unless you have some interest in the vb.net based sample code at the end of this post.
Ok, so the situation is as follows: your organisation still uses Visual Studio 2005, for whatever valid reason, and you wish to invoke the Muhimbi PDF Converter from a Visual Studio 2005 based application. Unfortunately the facility in Visual Studio 2005 that adds web references is not too happy with the default DataContractSerializer used by our WCF based service. Visual Studio 2005 uses the standard XmlSerializer, which is quite compatible, but not completely. Switching serialisers at runtime is not possible either as they are part of the data contract, which makes sense.
Solution 1 – Visual Studio 2005 extensions for .net 3.0
Once installed you can add a Service Reference using the following URL. Please do not use the Add Web Reference option, as that uses the old way of doing it.
Once the service reference has been added you can either use the sample VB.NET code listed at the end of this post or the C# code in our regular tutorial. Please note that depending on how you have named things, you may need to manually change the names of the sample namespaces.
Solution 2 – Create web service proxy manually using SVCUTIL.EXE
If Solution 1 doesn’t work for you, or you don’t want to install the VS2005 extensions, then you can also take the manual approach that uses svcutil.exe to create the web service proxy classes in the language of your choice. If you wish you can skip steps 1 to 4 and download the pre-generated proxies for VB and C#, as well as some other sample code, here.
The procedure is as follows:
You will need an updated version of svcutil.exe as the one that ships with VS2005 is not suitable, so download and install the Windows SDK.
If not already the case, please make sure the .net framework 3.0 is installed on your system as well. An easy way to check if it has already been installed is by checking if the following directory exists:
"%WINDIR%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation"
Make sure svcutil.exe is on your path (It is most likely located at C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin), and open the command prompt.
Create a folder or navigate to the directory where you want to create the proxy classes, e.g. c:\ws_proxy and execute the following command to generate the web service proxy classes:
This will result in the following output (note the version number of svcutil.exe).
You can read about the various parameters, including targeting different languages, in the svcutil documentation.
If you haven’t already created a Visual Studio 2005 project, then do so now (this sample uses vb.net for a change) and add the generated proxy file to the project.
Create a new WinForm, add a TextBox as well as a Button to it. Please accept the default names.
Double click the button and replace all code with the code displayed below.
Run the application, enter the name of an MS-Word file including the full path and click the button to convert the file and display the PDF.
Customers, customers, customers, you just can’t please them! Ever since we released support for Nintex Workflow, people have started to ask for K2 support…typical.
A commercial grade K2 Connector is, as of version 7.3, included in the PDF Converter for SharePoint. For details see this Knowledge Base article.
If we didn’t know any better, and had no windows in our office, we’d think spring has come early this year as our SharePoint products just keep delivering their offspring. We are only halfway into January and have already released a new version of our popular PDF Converter for SharePoint, a new version of the platform independent PDF Converter API & Server Platform and now a new SharePoint 2010 compatible version of the URL Shortener for SharePoint.
For those not familiar with the product, the Muhimbi URL Shortener for SharePoint, aka MuSH, can be used to shorten URLs for typical web applications and SharePoint in particular. It integrates tightly with WSS, MOSS as well as SharePoint 2010 and allows short URLs to be created directly from a list item’s context menu, workflows and web services. For details see the original announcement.
There are no major new features in this version, the main change is that the product has been made compatible with SharePoint 2010, while continuing to work in SharePoint 2007. We have also fixed a few minor issues and improved logging for some specific scenarios.
Last week’s release of version 4.1 of the PDF Converter for SharePoint shipped with an improved version of our popular PDF Conversion engine. Today we are releasing an update to the standalone version of the Muhimbi PDF Converter API and Server Platform that includes the same engine including all new functionality such as HTML to PDF Conversion and the many improvements we have made to the conversion of InfoPath documents.
Let’s have a look at some of the new functionality:
If you can’t wait to give it a go then proceed straight to the download link at the end of this post. Read on for a full list of all changes and improvements.
High level overview of the main Web Services based interface. Full Details can be found in the User / Developer Guide.
A quick introduction for those not familiar with the product: The Muhimbi PDF Converter API and Server Platform is a server based SDK that allows software developers to convert typical Office files to PDF format using a robust, scalable but friendly Web Services interface from Java and .NET based solutions. It supports a large number of file types including MS-Office and ODF file formats as well as HTML and Images based files and is used by some of the largest organisations in the world for mission critical document conversions. In addition to converting documents the product ships with a sophisticated watermarking engine and the ability to secure PDF files. A separate SharePoint specific version is available as well.
In addition to the changes listed above, some of the main changes in the new version are as follows:
642
New - Support for HTML to PDF Conversion in Web Service.
1011
New - Support for PDF conversion of common image types such as BMP, GIF, PNG, JPG.
870
New - Web Service method to allow existing PDF files to be watermarked.
1001
New - Automatically convert files attached to InfoPath forms to PDF.
993
New - Allow non-default InfoPath views to be selected for conversion to PDF.
1002
New - Allow multiple InfoPath views to be converted and merged into a single PDF file.
770
Fix - File system based XSN references are now decoded properly.
673
New - Allow range of InfoPath page numbers to convert to be specified.
1110
Fix - Borders are clipped incorrectly for watermarks.
1118
Fixed – Setup has more instructions and better account validation.
992
New - Setup now alerts the user of potential 'loopbackcheck' problems.
836
Fix - Applying Security on PDF files corrupts certain pages.
885
Fixed - Increased compatibility with InfoPath 2010.
882
Fixed - Size of watermarked documents have been improved by an order of magnitude.
882
Fixed - Performance of watermarking documents has been improved by an order of magnitude.<
1191
Fixed - Applying owner password on certain PDF files results in an error.
1116
New - Allow Converter Specific Settings to be specified on the Web Services Interface.
1130
New - Allow InfoPath Specific Settings to be specified on the Web Services Interface.
1117
New - Allow PowerPoint Specific Settings to be specified on the Web Services Interface.
757
New - Allow MS-Word Specific Settings to be specified on the Web Services Interface.
1080
New - Recovery options are now automatically configured for the Windows Service.
1145
Fixed - Fractions used in watermarks have been fixed for a number of locales.
1017
Fixed - Credentials were incorrectly cached for HTML to PDF Conversion.
1142
Fixed - Watermarking fill color no longer defaults to black.
1143
Fixed - Watermarking random positioning is now more random.
675
Fixed - Excel to PDF Conversion now allows range of page numbers to be specified.
1106
New - Allow custom credentials for the retrieval of InfoPath XSN files to be specified.
1146
New - Added additional details to Conversion Service trace log.
1152
Fixed - HTML to PDF URLs now allow spaces in the URL.
For more information check out the following resources:
As my grandfather always used to say, and I quote, “There is no better way to start the new year unless you have a brand new release of the popular Muhimbi PDF Converter for SharePoint in your hands”. Words of Wisdom!
All kidding aside, we initially planned to make this a small interim release that improves upon the existing functionality, but we got carried away and added some big feature as well.
For those not familiar with the product, the PDF Converter for SharePoint is a lightweight solution that allows end-users to convert common document types to PDF format from within SharePoint using a friendly user interface, workflows or a web service call without the need to install any client side software or Adobe Acrobat. It integrates at a deep level with SharePoint and leverages facilities such as the Audit log, localisation, security and tracing. It runs on WSS 3, MOSS as well as SharePoint 2010 and is available in English, German, Dutch, French, Traditional Chinese and Japanese. For detailed information check out the product page.
New Nintex Workflow 2007 & 2010 Workflow Actions
In addition to the changes listed above, some of the main changes in the new version are as follows:
803
New - Support for SharePoint 2010 Document Sets.
802
New - Select and Convert multiple files in SharePoint 2010.
894
New - SharePoint Designer Workflow Activity to secure PDF files.
895
New - Native support for Nintex Workflow 2007 and 2010.
1140
Fixed - HTML to PDF Conversion of SharePoint 2010 pages.
885
Fixed - Increased compatibility with InfoPath 2010.
882
Fixed - Size of watermarked documents have been improved by an order of magnitude.
882
Fixed - Performance of watermarking documents has been improved by an order of magnitude.
1118
Fixed - Service Installer now has more instructions and better account validation.
238
Fixed - Added support for Google Chrome, Apple Safari and other WebKit based browsers.
700
Fixed - Workflows started by files written via WEBDAV may not work correctly.
1154
Fixed - Converted PDF Files are sometimes saved as the System account.
1192
Fixed - Files that result in PDF files larger than 50MB are not accepted by the client.
1191
Fixed - Applying owner password on certain PDF files results in an error.
1186
Fixed - HTML containing pages inside Object tags can now be converted to PDF.
1197
Fixed - Negative page numbering causes an Exception in the MS-Word converter.
1116
New - Allow Converter Specific Settings to be specified on the Web Services Interface.
1130
New - Allow InfoPath Specific Settings to be specified on the Web Services Interface.
1117
New - Allow PowerPoint Specific Settings to be specified on the Web Services Interface.
757
New - Allow MS-Word Specific Settings to be specified on the Web Services Interface.
1080
New - Recovery options are now automatically configured for the Windows Service.
1145
Fixed - Fractions used in watermarks have been fixed for a number of locales.
1017
Fixed - Credentials were incorrectly cached for HTML to PDF Conversion.
1137
Fixed - Text and RTF Data can now be specified inside the watermark element.
1142
Fixed - Watermarking fill color no longer defaults to black.
1143
Fixed - Watermarking random positioning is now more random.
1153
New - Misspelled attributes in composite watermarks are now reported.
1157
Fixed - Watermarking related workflow actions have been made more reliable.
675
Fixed - Excel to PDF Conversion now allows range of page numbers to be specified.
1106
New - Allow custom credentials for the retrieval of InfoPath XSN files to be specified.
1146
New - Added additional details to Conversion Service trace log.
1152
Fixed - HTML to PDF URLs now allow spaces in the URL.
1164
Fixed - ArgumentNullException in Central Admin for people upgrading from very old versions.
For more information check out the following resources: