Using the Mako Core SDK to modify documents in Microsoft’s Universal Print

Over the past year, Microsoft has been working hard to bring its new Cloud printing service, Universal Print, to general availability.

As a part of Universal Print, developers get access to a set of Graph APIs that allows analysis and modification of print job payload data. This feature enables a few different scenarios, including adding security (e.g. redactions or watermarks) to a Universal Print-based workflow.

As a curious engineer, I wanted to see how different it would be for an independent software vendor (ISV) to use our Mako™ Core SDK to modify a print job flowing through Universal Print, instead of using a more traditional route of using a virtual printer driver.

Thinking about the workflow a little more, I came up with the following design:

Using the Mako SDK to modify documents in Universal Print.
Using the Mako SDK to modify documents in Universal Print.

In the design above, we can see the end-user’s Word document gets printed to a virtual printer. This allows the ISV to be notified of the job, and modify it accordingly using Mako. Once modified, the ISV then redirects the job on to the physical printer for printing.

There’s a couple of nice things about this design:

Firstly, it uses the Graph API to access Universal Print, which is an easy-to-use and well documented REST API. Secondly, since the functionality is accessed via a REST API, it allows our ISV service to be written in whichever Mako supported language we like.

I chose C# to make best use of the C# Graph API SDK.

Developing the service

There are five main steps to developing the service:

  1. Handle print job notifications
  2. Download the print job payload
  3. Modify the payload
  4. Upload the payload
  5. Redirect to the target printer

Handle print job notifications

To be notified of print jobs in Universal print, you can use the Graph’s change notifications. These will allow you to sign up to a notification, which will call a provided webhook.

Download the print job payload

Once we have notification that a print job has been sent to our virtual printer, we can start downloading its payload.

Here we use the appropriate Graph APIs, along with standard Graph authentication to access the print job’s document. We then simply save it to disk.

Modify the payload

Once we have the document on disk (although Mako can also modify streams too!), we can open the document and modify it using Mako’s document object model (DOM).

Alternatively, Mako can also convert from one page description language (PDL) to another. This is useful in situations where your destination printer doesn’t support the input PDL.

Upload the payload

Uploading the modified document is straightforward. This time we use the Graph API to create an upload session, and use the WebClient class to put the document back into the original print job.

Redirect to the target printer

And finally, after the print job has been updated, we can redirect it onto another printer. This redirection also automatically completes the print job and task.

Alternatively, if we want to be a little more green, we could always send the document to OneDrive, Sharepoint, or another document management system. After doing so, you then complete the print job and its associated task.

See it in action

We actually coded this demo live in our last Mako webinar, showing an implementation where an ISV wants to automatically redact content.

Access the code directly at our GitHub repository or watch the webinar recording below:

Try it out

We’re keen to talk to you about your Universal Print project and see how we can help. Contact us here.

For more information about Mako, visit globalgraphics.com/mako.

About the author

Andy Cardy, Principal Engineer at Global Graphics Software
Andy Cardy, Principal Engineer at Global Graphics Software

Further reading:

  1. Carry out complex tasks for your print workflow easily with Mako
  2. Improving PDF accessibility with Structure Tagging

Be the first to receive our news updates and product news. Why not subscribe to our monthly newsletter? Subscribe here

Follow us on LinkedIn and Twitter

RIP technology replacement achieves a faster development time, performance and quality benchmarks

 VIR Softech replaces RIP software for major print OEM and achieves a faster development time, performance and quality benchmarks

When a major print OEM switched from a market-leading RIP technology to the Harlequin RIP®, they achieved a faster development time and performance and quality benchmarks with a reduced bill of materials cost.

The Challenge
When a leading print OEM was looking to move to a PDF RIP technology that was easy to integrate and help to achieve quality and performance benchmarks, it contacted Global Graphics Software Partner Network member, Vir Softech. As a RIP replacement service provider, the team at Vir Softech includes experienced engineers, with experts who have worked on all the major RIP technologies and understand the interfaces and functions they offer.

The Solution
Vir Softech recommended switching from the existing RIP technology to the Harlequin RIP from Global Graphics Software. Vir Softech had experience of using the Harlequin RIP in a similar project and knew it would meet the print OEM’s requirements. After a period of evaluation, including quality and performance benchmarking, the print OEM chose to use the Harlequin RIP.

Deepak Garg, managing director at Vir Softech explains the process: “The first step towards making the change was to assess and understand the various features and functions offered by the OEM’s print devices.”

After investigating, the team prepared a design document highlighting:

  • The OEM’s product features that interact with the RIP technology
  • How these product features are implemented
  • The various RIP interfaces which are used to implement these features and functions

Deepak continues: “Once the print OEM decided to go ahead, we prepared another document highlighting how to achieve these functions using the Harlequin interfaces. Some functions or features could not be implemented using Harlequin directly, such as special color handling, spot color replacement, extraction of cut data etc., so we contacted Global Graphics Software who was able to provide a design showing how these functions could be implemented using Harlequin. We then prepared a proof-of-concept, or working implementation, which demonstrated how the Harlequin RIP would work with the print OEM’s print devices. With Harlequin, such a prototype can usually be achieved within three to six months.”

The Result
Development time was much shorter than usual for such an ambitious undertaking, greatly reducing costs and enabling the print OEM to drive their revenue earlier than originally expected. The print OEM began using the Harlequin RIP, instantly meeting its quality and performance targets.

The print OEM says: “The Harlequin RIP helped us to move to native PDF printing and achieve the performance targets for our printers. Harlequin also helped us to reduce the lead time for getting our products to market while keeping development and maintenance costs low.”

About Vir Softech
Vir Softech is a technology start-up with expertise in imaging and computer vision technologies. With a strong focus in the Print & Publishing domain, its team of experienced engineers includes experts in all aspects of imaging and RIP technologies, such as job management, job settings, color management, screening, bands generation and management, VDP and imposition etc.

The team at Vir Softech are experts in configuring RIP technologies for better performance targeted for a specific market segment such as production, commercial, large format and enterprise printing. Some of the areas where Vir Softech can help include low resource environment, implementing OEM-specific unique functions using Harlequin RIP interfaces, making use of OEM ASIC for better performance, making use of OEM hardware accelerators for some of the computer-intensive RIP operations such as color conversion, image transformations, image decoding, rendering etc and achieving PPM target of MFP for ISO test suites.

To find out more visit: www.virsoftech.com