Subscribe to News feed

Adding a watermark to a PDF file from a SharePoint Workflow

Posted at: 12:18 on 26 January 2010 by Muhimbi

We get a great amount of interest from our existing PDF Converter customers for the Workflow Power Pack for SharePoint. I am not really surprised as there is a lot of of synergy between the two.

Last week I described how to configure PDF Security settings from a SharePoint workflow. This time I’ll describe another common request; adding a watermark to a PDF File.

A quick introduction for those not familiar with the product: The Muhimbi Workflow Power Pack for SharePoint allows custom C# or VB.NET code to be embedded in SharePoint Designer Workflows without the need to resort to complex Visual Studio based workflows, the development of bespoke Workflow Activities or long development cycles.

The solution presented below executes a workflow whenever a PDF file is added or updated. As part of the workflow it loads portrait and landscape based watermarks and applies the relevant template to each page of the document. The workflow author can specify if the watermark goes in the foreground or the background, the SharePoint location of the watermarks as well as the level of transparency. As the code is well documented it is easy to make further changes and customisations, e.g. the PDF file that needs to be watermarked may not be the file the workflow is acting on.

Update: An article describing the use of dynamic text in the watermark is now available as well. As of version 3.5 the PDF Conversion Service also supports a native watermarking interface.

 WatermarkedPages

 
Create the workflow as follows:

  1. Download and install the Muhimbi Workflow Power Pack for SharePoint.
     
  2. Download and install the Muhimbi PDF Converter for SharePoint.
    Note that you need version 3.1.2.18 or newer, older versions do not allow watermarking.
     
  3. Download this article’s source code and sample watermarks.
     
  4. We need to be able to access functionality in the Muhimbi.SharePoint.DocumentConverter.PDF and System.Drawing assemblies. Add these references to the relevant Web Application using the Workflow Power Pack Central Administration screens as described in the Administration Guide. Make sure to place each reference on a new line.
      
  5. Make sure you have the appropriate privileges to create workflows on a site collection.
     
  6. Create a new workflow using SharePoint Designer.
     
  7. On the Workflow definition screen associate the workflow with the Shared Documents library, tick the boxes next to both ‘Automatically start….’ options and proceed to the next screen.
     
  8. We only want to act on files of type PDF. Although we could have put this validation in the code, in this example we use a workflow condition for it so add a Compare Any Data Source condition and:
     
    a.  Click on the first value followed by the display data binding (fx) button.
    b.  Select Current Item as the Source and select File Type in the Field. Click the OK button to continue.
    d.  Click on the second value and enter pdf. (Use lower case as the compare option is case sensitive).
     
  9. Click the Actions button and insert the Execute Custom Code action.
     
  10. Optionally click parameter 1 and enter a relative or absolute destination path. Leave the parameter empty to save the watermarked file on top of the existing PDF file. For details about how paths are handled, see this post and search for the words ‘this url’.
     
  11. Insert the C# based code embedded in step #3’s download (also listed below) by clicking this code.
     
    /*********************************************************************************************
                                 Muhimbi PDF Converter - Watermarking
     
                  Copyright 2010, Muhimbi Ltd - www.muhimbi.com - All rights reserved
     
     The following code shows a simple way of adding a watermark to existing PDF Files. 
     Error and permission checking as well as other minor features have been omitted for the sake 
     of brevity and clarity.
     
     Ideally PDF Conversion, applying security and watermarking is executed in the same step, see 
     http://www.muhimbi.com/blog/2010/01/configure-pdf-security-from-sharepoint.html
     
     This code requires Muhimbi’s PDF Converter and Workflow Power Pack to be installed.
    *********************************************************************************************/
     
    using System.Drawing;
    using System.IO;
    using Syncfusion.Pdf;
    using Syncfusion.Pdf.Parsing;
    using Syncfusion.Pdf.Graphics;
    using Muhimbi.SharePoint.DocumentConverter.PDF;
     
    SPFile spSourceDocument = MyWorkflow.Item.File;
     
    string destinationFileName = spSourceDocument.Name;
    string destinationFolderName = MyWorkflow.Parameter1 as string;
    string watermarkDocumentPortraitPath = @"Shared Documents/Watermarks/WatermarkA4Portrait.pdf";
    string watermarkDocumentLandscapePath = @"Shared Documents/Watermarks/WatermarkA4Landscape.pdf";
     
    // ** z-order and transparency of the watermark
    bool watermarkInBackground = true;
    float watermarkTransparancy = 0.25f;
     
    // ** Load the document and watermarks
    PdfLoadedDocument sourceDocument = new PdfLoadedDocument(spSourceDocument.OpenBinary());
    SPFile spWatermarkDocumentPortrait = MyWorkflow.Web.GetFile(watermarkDocumentPortraitPath);
    PdfLoadedDocument watermarkDocumentPortrait = new PdfLoadedDocument(
                                                    spWatermarkDocumentPortrait.OpenBinary());
    SPFile spWatermarkDocumentLandscape = MyWorkflow.Web.GetFile(watermarkDocumentLandscapePath);
    PdfLoadedDocument watermarkDocumentLandscape = new PdfLoadedDocument(
                                                    spWatermarkDocumentLandscape.OpenBinary());
     
    // ** Create the PDF Templates
    PdfTemplate watermarkTemplatePortrait = watermarkDocumentPortrait.Pages[0].CreateTemplate();
    PdfTemplate watermarkTemplateLandscape = watermarkDocumentLandscape.Pages[0].CreateTemplate();
     
    // ** Iterate over all pages and apply watermark
    foreach (PdfPageBase page in sourceDocument.Pages)
    {
        // ** Is the current page portrait or landscape?
        PdfTemplate watermarkTemplate = null;
        if (page.Size.Width > page.Size.Height)
            watermarkTemplate = watermarkTemplateLandscape;
        else
            watermarkTemplate = watermarkTemplatePortrait;
     
        // ** Place watermark behind or in front of text?
        if (watermarkInBackground == true)
        {
            PdfTemplate pageTemplate = page.CreateTemplate();
            page.Layers.Clear();
            PdfGraphics g = page.Graphics;
            g.SetTransparency(watermarkTransparancy);
            g.DrawPdfTemplate(watermarkTemplate, PointF.Empty, page.Size);
            g.SetTransparency(1f);
            g.DrawPdfTemplate(pageTemplate, PointF.Empty, page.Size);
        }
        else
        {
            PdfGraphics g = page.Graphics;
            g.SetTransparency(watermarkTransparancy);
            g.DrawPdfTemplate(watermarkTemplate, PointF.Empty, page.Size);
        }
    }
     
    // ** Construct the path and file to write the watermarked PDF file to.
    if (string.IsNullOrEmpty(destinationFolderName) == true)
        destinationFolderName = spSourceDocument.ParentFolder.Url;
    SPFolder destinationFolder = Utility.GetSPFolder(destinationFolderName, MyWorkflow.Web);
    string destinationFilePath = string.Format("{0}/{1}", destinationFolder.Url,
                                               destinationFileName);
    SPWeb destinationWeb = destinationFolder.ParentWeb;
    SPFile spDestinationFile = destinationWeb.GetFile(destinationFilePath);
     
    // ** If a document library requires manual checkout and the file is not checked out, then 
    // ** check the file out before uploading.
    if (spDestinationFile.Exists && spDestinationFile.Item.ParentList.ForceCheckout &&
        spDestinationFile.CheckOutStatus == SPFile.SPCheckOutStatus.None)
    {
        spDestinationFile.CheckOut();
    }
     
    // ** Add the file to the site including the meta data
    using (MemoryStream watermarkedFile = new MemoryStream())
    {
        sourceDocument.Save(watermarkedFile);
        spDestinationFile = destinationWeb.Files.Add(destinationFilePath, watermarkedFile,
                                                     spSourceDocument.Item.Properties, true);
    }
     
    // ** Check the file back in if this script was responsible for checking it out.
    if (spDestinationFile.Item.ParentList.ForceCheckout == true)
    {
        spDestinationFile.CheckIn("Auto check-in after PDF watermarking.");
    }
        
  12. Click the Actions button, select Log to History List, click this message and enter File watermarked.
     
  13. Close the Workflow Designer.
     
  14. In the Shared Documents library create a sub folder named Watermarks and copy the 2 watermark files that are part of step #3’s download into it. If the watermarks are named differently or stored in a different location then update the paths in the script accordingly. Note that the sample watermarks are exactly A4 sized but they work fine on differently sized documents.
     
  15. Update an existing PDF or add a new PDF file to your library to trigger the workflow and apply the watermarks.
     

WaterMarkScript 

Naturally this is just a simple example. Feel free to play around with the code, change which parameters are passed into the workflow, modify where watermarked files are written to or add dynamic text as a watermark. Leave a comment below if you are trying to do anything specific.

.





Labels: , , , , ,

How we license our products – Make sure your organisation is compliant

Posted at: 12:03 on 22 January 2010 by Muhimbi

LicenseAny organisation that deals with computer software, free or otherwise, must be aware of the License Agreement that comes with a software product. How many computers can the software be used on, by how many users and how long is the license valid are only some of the questions that need to be answered.

No time to read the whole post? Read this short but clear Knowledge Base article for details about how to determine the number of servers that need licensing.

We have invested quite some time in making our Software License Agreement readable for people without a legal background. However, it is difficult to cover all grounds using plain English.

This post attempts to explain the key elements of our Software Agreement in plain English. Note that this is only a summary and does not replace the actual License Agreement.

The following topics are discussed in this post:

 

Summary of available licenses

The following license types apply to our ‘on-premise’ products. An overview of subscription tiers for the Muhimbi PDF Converter for SharePoint Online / Office 365 can be found here.

We use a graded licensing system to match your budget and exact needs. The following license types are available: 

  • Free evaluation version: If the software is installed without a license then you are using the evaluation version. The software is fully functional without any time limits, but an evaluation message will be displayed on most screens, in the workflow history and in any generated document. You are not permitted to use the evaluation version in production environments. Support is provided using any of the means in the Support area on our site. 
     
  • Basic License: Starter edition for SharePoint farms consisting of a single combined WFE / App server.
     
  • Small Farm License: Covers a single SharePoint farm consisting of up to 3 servers with support for load balancing and redundancy.
     
  • Enterprise License: Covers an unlimited number of SharePoint Farms, Servers and Users in a single legal entity.  
     
  • OEM License: If you wish to bundle our software with your own solution and redistribute it to 3rd parties then you require an OEM License. Please read the details in the Software License Agreement for more information. Note that you are not allowed to use our Products to develop derived works that offer similar functionality as the Product or expose the features of the Product for use by an unlicensed third party unless agreed with Muhimbi. From a licensing perspective embedding our software in a SAAS based solution is considered redistributing our software and requires an OEM license. 
     


Renewing Licenses / Support licenses

Independent of the type of license purchased you automatically receive a 1 year support license, which entitles you to free updates and access to our support desk using any of the means listed on the Contact Us page.

After the support license has expired your software will continue to work, but you can no longer deploy new versions released after the expiry of the license. You can renew your support license for 30% of the current retail price, which is not necessarily the price you originally bought the product for, although they may be the same.

 

What servers / environments do you need a license for

Some vendors charge extra license fees for Development or Test environments, which - quite frankly - we find a questionable practice. The most common environments are summarised below with an explanation about any extra licenses needed.

  • Development: This environment is commonly used by Software or SharePoint developers to create or update solutions using tools such as Visual Studio and SharePoint Designer. Providing our software is used for development purposes only, and not used for any production purposes, then you don’t need a separate license for this environment. Examples of Production use in a Development environment is running our PDF Converter on the Development Team’s SharePoint Server that is used for production purposes, e.g. storing documents for the development projects.
     
  • Systems Test: Once development on a software project has finished the solution is commonly installed and tested in a clean test environment that resembles the Production environment. Providing this environment is not used for Production purposes, it rarely is, you do not need an extra license.
     
  • User Acceptance Test: Once the development team has finished development the end-users usually test the solution as well to see if it matches the requirements and functions as expected. Some organisations use the Systems Test environment for this, but other organisations have a separate UAT environment. Providing this environment is not used for Production purposes, it rarely is, you do not need an extra license.
     
  • Support: Some organisations run an identical copy of their Production environment in a so called Support environment. Quite often this environment runs very recent data based on backups taken the day before. Support staff can assist users and troubleshoot problems on a relatively up to date copy of the system without impacting the data in the Production system. From a licensing perspective this is a grey area as this environment is sometimes used for Production purposes. For example, if a Production user requests assistance with the conversion of a PDF file and this conversion is then carried out by a member of the support team in the Support environment, and the resulting file is transferred to the user, then this is considered Production use and you need a license for this environment.
     
  • Staging: Depending on the kind of solutions in place, an organisation or team may need a staging environment. Staging environments are commonly used for, but not limited to, content management based solutions to prepare content for an Intranet or public web site. If the staging environment is used for preparing production data then you need a license for this environment:
     
  • Production: Production environments always require a license.
     
  • Disaster Recovery: Many of the larger organisations mirror their production environment in an off-site Disaster Recovery Centre. From a licensing perspective we consider Disaster Recovery Centres to be Production environments, even if disaster never strikes and the environment is never used.
     
  • SAAS Based solutions: From a licensing perspective embedding our software in a SAAS based solution is considered redistributing our software and requires an OEM license.

Muhimbi's software is licensed on a 'per server' basis. This means that you need a license for every Production and Disaster Recovery server that runs our software. In case of the PDF Converter for SharePoint  this means all Web Front End servers, all Application Servers participating in workflows (how to determine this) and all servers running the conversion service. Any K2 Workflow Servers that have our K2 integration facilities installed require a license as well.

         

Differences between the PDF Converter Web Service, PDF Converter for SharePoint and PDF Converter Professional

The PDF Converter for SharePoint as well as the PDF Converter Services share a common conversion engine.  However these are separate products and licensed accordingly. The PDF Converter for SharePoint may only be used from SharePoint based environments whereas the PDF Converter Services may be used from any environment including SharePoint, Java, .NET and other web services capable systems.

The PDF Converter Professional license is an add-on that adds additional functionality to either the PDF Converter for SharePoint or the PDF Converter Services. This functionality, e.g. PDF/A post-processing and OCR, is usually associated with more complex environments and has therefore been separated from the main product. Please note that the PDF Converter Professional is a license that must be applied alongside a valid license of the PDF Converter for SharePoint or PDF Converter services. A separate download of the Professional version of the software is not needed, the license unlocks all functionality.

Make sure you purchase the correct product based on your needs and environment. If you are already licensed for the PDF Converter for SharePoint and wish to use it from non-SharePoint based environments as well then please contact us and we’ll provide a competitive upgrade code.

 

I realise this post is almost longer than the License Agreement it is trying to explain, but I hope it clarifies our licensing position. If you have any further questions then please check out the following sources or contact us at licensing@muhimbi.com.

.

Labels: , , , , , ,

PDF Converter for SharePoint 3.1 – With new Visio and improved InfoPath Conversion

Posted at: 16:10 on 20 January 2010 by Muhimbi

OfficeIcons5

It has been exactly 2 months since we released a completely overhauled version of our PDF Converter for SharePoint. We are seeing a considerable increase in downloads as well as purchases, which means one thing….. increased customer feedback!

The new version of the software resolves the most urgent issues, removes a number of pain points that should make configuration for certain scenarios a lot easier, improves support for the more complex InfoPath forms and adds support for converting MS-Visio files as well as a number of related vector formats (vsd, vdx, svg, svgz, dwg, dxf).

For those not familiar with the product, the PDF Converter for SharePoint is a lightweight solution (4MB download) that allows end-users to convert common document types to PDF format from within SharePoint 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 both WSS 3 as well as MOSS and is available in English, German, Dutch, French and Japanese. For detailed information check out the product page as well as the following blog postings:

workflow26

Convert files using the User Interface or an automated Workflow

The main changes in version 3.1 are as follows:

754 Fixed: InfoPath data files without a shared template location cannot be converted.
751 New: Added support for conversion of Visio and other vector based file types, including AutoCad.
671 Improved: Support for ‘difficult’ InfoPath documents containing Full Trust .net code.
739 Improved: Remove manual configuration steps for systems that store .dotx templates in SharePoint.
740 Improved: Remove manual configuration steps for documents that contain Document Information Panels.
495 Fixed: Using the Browse button to navigate to the root of a renamed document library doesn't work.
289 Fixed: Cannot select folder in Tree picker when the file name is empty.
736 Fixed: Meta data of type ‘Date’ is not copied over correctly for Office 2007 based files.

For more information check out the following resources:

As always, feel free to contact us using Twitter, our Blog, regular email or subscribe to our newsletter.

Download your free trial here (4MB). .





Labels: , , ,

Configure PDF Security from a SharePoint Workflow

Posted at: 16:35 on 15 January 2010 by Muhimbi

combination_lock Our PDF Converter for SharePoint is getting great reviews, but naturally we cannot please everyone, or at least not yet. One of the requests we get from time to time is to add support for the ability to specify PDF Security settings (Open Password, Owner Password, Block Print, Block Copy etc).

Update: It is now possible to apply PDF Security settings using a native SharePoint Designer workflow activity. It is no longer necessary to use the Workflow Power Pack approach outlined in this post, although it may still be useful for those users who want ultimate control and carry out the conversion and application of security in one go.

The thing is, our underlying engine and Web Service interface already support this functionality. However, the user interface and workflow action have not yet been updated. In this article we describe how to access this ‘hidden’ functionality from a workflow using the Workflow Power Pack.

A quick introduction for those not familiar with the product: The Muhimbi Workflow Power Pack for SharePoint allows custom C# or VB.NET code to be embedded in SharePoint Designer Workflows without the need to resort to complex Visual Studio based workflows, the development of bespoke Workflow Activities or long development cycles.

The solution presented below automatically converts any updated or newly created files to PDF format and applies the DisablePrint and DisableContentCopy security flags to the file. As the code is well documented it is easy to make further changes and customisations.

image

 
Create the workflow as follows:

  1. Download and install the Muhimbi Workflow Power Pack for SharePoint.
     
  2. Download and install the Muhimbi PDF Converter for SharePoint.
     
  3. We need to be able to access functionality in the Muhimbi.SharePoint.DocumentConverter.PDF, System.ServiceModel and System.Runtime.Serialization assemblies. Add these references to the relevant Web Application using the Workflow Power Pack Central Administration screens as described in the Administration Guide. Make sure to place each reference on a new line.
      
  4. Make sure you have the appropriate privileges to create workflows on a site collection.
     
  5. Create a new workflow using SharePoint Designer.
     
  6. On the Workflow definition screen associate the workflow with the library of your choice, tick the boxes next to both ‘Automatically start….’ options and proceed to the next screen.
     
  7. To prevent the code from acting on files that are already in PDF format, add a Compare Any Data Source condition and:
     
    a.  Click on the first value followed by the display data binding (fx) button.
    b.  Select Current Item as the Source and select File Type in the Field. Click the OK button to continue.
    c.  Click equals and change it to not equals.
    d.  Click on the second value and enter pdf.
     
  8. Click the Actions button and insert the Execute Custom Code action.
     
  9. Click parameter 1 and optionally enter a relative or absolute destination path (For details see this post and search for the words ‘this url’). Leave the parameter empty to write the PDF file to the same directory as the source file.
     
  10. Download the source code or insert the C# based code listed below by clicking this code.
     
    /********************************************************************************************
                                      Muhimbi PDF Converter
     
                  Copyright 2010, Muhimbi Ltd - www.muhimbi.com - All rights reserved
     
     The following code is a simplification of the code that is normally executed by the Muhimbi 
     PDF Converter Workflow Action. Error and permission checking as well as other minor features
     have been omitted for the sake of brevity and clarity.
     
     This code allows more control over the PDF Conversion process compared to what is possible 
     with the Out-Of-The-Box action, for example: PDF Security Options, Use of PDF/A, Quality, 
     Enable Macros and the ability to specify a password to open a source file.
     
     This code requires Muhimbi’s PDF Converter and Workflow Power Pack to be installed.
     
     For details about the Web Services interface see:
     
     http://www.muhimbi.com/blog/2009/12/converting-office-files-to-pdf-format.html
     
    ********************************************************************************************/
     
    using Muhimbi.SharePoint.DocumentConverter.PDF;
    using Muhimbi.SharePoint.DocumentConverter.PDF.WebServiceClient;
    using System.Collections;
     
    // ** Set all variables required for the conversion of the file.
    SPFile sourceFile = MyWorkflow.Item.File;
    // ** Specify an empty string or null to use the same directory as the source file. 
    // ** Alternatively specify an absolute or relative (to the web) path, e.g. 
    // ** subsite1/Shared Documents/PDF  or /sites/HumanResources/subsite1/Shared Documents/PDF
    string          destinationFolderName   = MyWorkflow.Parameter1 as string;
    string          destinationFileName     = Utility.ExtractFileName(sourceFile.Name) + ".pdf";
    string          openPassword            = "";
    string          ownerPassword           = "A Nice And Strong Password!";
    SecurityOptions securityOptions         = SecurityOptions.DisablePrint | 
                                              SecurityOptions.DisableContentCopy;
    bool            copyMetadata            = true;
     
    // ** Get a reference to the PDF Converter web service.
    DocumentConverterServiceClient client   = WebServiceConverterHelper.OpenService();
     
    //** Set the various open options
    OpenOptions openOptions                 = new OpenOptions();
    openOptions.Password                    = "";
    openOptions.OriginalFileName            = sourceFile.Name;
    openOptions.FileExtension               = Utility.ExtractFileExtension(sourceFile.Name);
    openOptions.AllowMacros                 = MacroSecurityOption.None;
    openOptions.RefreshContent              = true;
     
    //** Specify the various security settings
    ConversionSettings conversionSettings   = new ConversionSettings();
    conversionSettings.Fidelity             = ConversionFidelities.Full;
    conversionSettings.Format               = OutputFormat.PDF;
    conversionSettings.Quality              = ConversionQuality.OptimizeForPrint;
    conversionSettings.Range                = ConversionRange.VisibleDocuments;
    conversionSettings.StartPage            = 0;
    conversionSettings.EndPage              = 0;
    conversionSettings.GenerateBookmarks    = BookmarkGenerationOption.Automatic;
    conversionSettings.PDFProfile           = PDFProfile.PDF_1_5;
    // ** Specify either an Open or Owner Password in order to activate the security Options
    conversionSettings.OpenPassword         = openPassword;
    conversionSettings.OwnerPassword        = ownerPassword;
    conversionSettings.SecurityOptions      = securityOptions;
     
    // ** Read the content of the source file
    byte[] sourceFileArray = sourceFile.OpenBinary();
    // ** Carry out the actual conversion to PDF
    byte[] convertedFile = client.Convert(sourceFileArray, openOptions, conversionSettings);
     
    // ** Construct the path and file to write the PDF file to.
    if (string.IsNullOrEmpty(destinationFolderName) == true)
        destinationFolderName = sourceFile.ParentFolder.Url;
    SPFolder destinationFolder = Utility.GetSPFolder(destinationFolderName, MyWorkflow.Web);
    string destinationFilePath = string.Format("{0}/{1}", destinationFolder.Url, 
                                               destinationFileName);
    SPWeb destinationWeb = destinationFolder.ParentWeb;
    SPFile spDestinationFile = destinationWeb.GetFile(destinationFilePath);
     
    // ** If a document library requires manual checkout and the file is not checked out, then 
    // ** check the file out before uploading.
    if (spDestinationFile.Exists && spDestinationFile.Item.ParentList.ForceCheckout && 
        spDestinationFile.CheckOutStatus == SPFile.SPCheckOutStatus.None)
    {
        spDestinationFile.CheckOut();
    }
     
    // ** Copy metadata, if requested.
    if (copyMetadata == true && 
        sourceFile.Name.EndsWith("x", StringComparison.InvariantCultureIgnoreCase) == false)
    {
        // ** Pre office 2007 formats (without the trailing x) are treated differently 
        // ** from the office 2007 formats when it comes to copying meta data.
        Hashtable metadata = sourceFile.Item.Properties;
        // ** Add the file to the site including the meta data
        spDestinationFile = destinationWeb.Files.Add(destinationFilePath, convertedFile, 
                                                     metadata, true);
    }
    else if (copyMetadata == true)
    {
        // ** Add the file to the site.
        spDestinationFile = destinationWeb.Files.Add(destinationFilePath, 
                                                     convertedFile, null, true);
        // ** Copy the Actual meta data to the newly created file.
        foreach (SPField field in sourceFile.Item.Fields)
        {
            if (field.ReadOnlyField == false && 
                spDestinationFile.Item.Fields.ContainsField(field.InternalName) == true)
            {
                spDestinationFile.Item[field.InternalName] = sourceFile.Item[field.InternalName];
            }
        }
        // ** Update the meta data
        spDestinationFile.Item.Update();
    }
    else
    {
        // ** Actively strip all meta data
        Hashtable metadata = new Hashtable(sourceFile.Item.Properties.Count);
        foreach (Object key in sourceFile.Item.Properties.Keys)
        {
            metadata.Add(key, string.Empty);
        }
        // ** Add the file to the site with all meta data stripped
        spDestinationFile = destinationWeb.Files.Add(destinationFilePath, convertedFile, 
                                                     metadata, true);
    }
     
    // ** Check the file back in if this script was responsible for checking it out.
    if (spDestinationFile.Item.ParentList.ForceCheckout == true)
    {
        spDestinationFile.CheckIn("Auto check-in after PDF Conversion");
    }
      
  11. Click the Actions button, select Log to History List, click this message and enter File converted to PDF.
     
  12. Close the Workflow Designer and update or add an item to your library to trigger the workflow.
     
SetPDFSecurity

 
Naturally this is just a simple example. Feel free to play around with the code, change which parameters are passed into the workflow or modify where converted PDF files are written to.

.





Labels: , , , ,

PDF Converter for SharePoint – The first award is in!

Posted at: 10:34 on 11 January 2010 by Muhimbi

party_hat Wow, this is a nice Monday morning surprise. When I checked my mailbox this morning there was an email from SharePointReview’s Inna Gordin announcing that the Muhimbi PDF Converter for SharePoint has won the December 2009 Top User Rated Product Award.

So, we are now officially Award Winning, which is great. We’ll aim to keep our products’ quality and degree of innovation at a high level to make sure this is not the last award we’ll win.

Please check out our other products on SharePointReviews.com and leave a rating if you like what you see. We are a small company and it really means a lot to our team.

SPRawards-user-Dec09

For the latest news please subscribe to our RSS feed or follow us on Twitter.

.

Labels: , , ,

Using SharePoint Infuser on a Publishing Site

Posted at: 15:02 on 07 January 2010 by Muhimbi

Syringe We are getting some fantastic feedback from users who are using our free SharePoint Infuser tool to inject all kinds of Magic into their SharePoint pages.

However, some users who are using Publishing Sites have reported that the tool is not working for them. This is because the ‘AdditionalPageHead’ delegate control is usually not present in the Master Page of a publishing site.

If you are keen to use Infuser in your Publishing Site then add the following line to your Publishing Site’s master page.

    <SharePoint:DelegateControl runat="server" ControlId="AdditionalPageHead" AllowMultipleControls="true"/>

That’s all. Have fun.

.






Labels: ,

Need support from experts?

Access our Forum

Download Free Trials