Skip to content

Instantly share code, notes, and snippets.

Avatar

Mako SDK mako-sdk

View GitHub Profile
@mako-sdk
mako-sdk / CheckLinearized.cpp
Created Apr 27, 2021
Short example that shows obtaining metadata and checking a specific value
View CheckLinearized.cpp
// CheckLinearized.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <jawsmako/jawsmako.h>
#include <jawsmako/pdfinput.h>
#include <edl/idommetadata.h>
using namespace JawsMako;
using namespace EDL;
@mako-sdk
mako-sdk / 1-DownloadPrintJobPayload.cs
Last active Apr 26, 2021
Mako and Universal Print
View 1-DownloadPrintJobPayload.cs
var printDocument = job.Documents.First();
var jobFile = new FileInfo("temp.oxps");
await using (var documentStream = await client.Print.Printers[printerId].Jobs[jobId].Documents[printDocument.Id].Content.Request().GetAsync())
{
Console.WriteLine("Downloading...");
await using var file = File.Create(jobFile.FullName);
await documentStream.CopyToAsync(file);
}
@mako-sdk
mako-sdk / makodistiller.cpp
Created Mar 23, 2021
A Mako converter that uses the IDistiller class for speedy conversion of PostScript to PDF
View makodistiller.cpp
/*
* Copyright (C) 2020-2021 Global Graphics Software Ltd. All rights reserved
*
* Simple sample application for converting PS to PDF using the JawsMako APIs.
*/
#include <algorithm>
#include <exception>
#include <iostream>
#include <stdexcept>
@mako-sdk
mako-sdk / makoshapetest
Last active Mar 10, 2021
An example to demonstrate the use of IDOMShape and shape operations. Use in conjunction with the related PDF IDOMShapeTest.pdf.
View makoshapetest
/*
* Copyright (C) 2013-2021 Global Graphics Software Ltd. All rights reserved
*
* Simple sample application for testing shapes using the JawsMako APIs.
*/
#include <algorithm>
#include <exception>
#include <iostream>
#include <stdexcept>
@mako-sdk
mako-sdk / makoOPIremover.cpp
Created Jan 30, 2021
A sample based on makoconverter that includes a custom transform that removes OPI comments from forms and images
View makoOPIremover.cpp
/*
* Copyright (C) 2013-2021 Global Graphics Software Ltd. All rights reserved
*
* Simple sample application for conversions using the JawsMako APIs.
* with a custom transform to remove OPI comments
*/
#include <algorithm>
#include <exception>
#include <iostream>
@mako-sdk
mako-sdk / makoconverter.cpp
Created Jan 28, 2021
A version of the standard example makoconverter that demonstrates how to read a PJL-wrapped PDF
View makoconverter.cpp
/*
* Copyright (C) 2013-2021 Global Graphics Software Ltd. All rights reserved
*
* Simple sample application for conversions using the JawsMako APIs.
*/
#include <algorithm>
#include <exception>
#include <iostream>
#include <stdexcept>
@mako-sdk
mako-sdk / makoalphachan.cpp
Created Jan 25, 2021
Renders a PDF to a PNG with an alpha channel.
View makoalphachan.cpp
// -----------------------------------------------------------------------
// <copyright file="makoalphachan.cpp" company="Global Graphics Software Ltd">
// Copyright (c) 2021 Global Graphics Software Ltd. All rights reserved.
// </copyright>
// <summary>
// This example is provided on an "as is" basis and without warranty of any kind.
// Global Graphics Software Ltd. does not warrant or make any representations
// regarding the use or results of use of this example.
// </summary>
// -----------------------------------------------------------------------
@mako-sdk
mako-sdk / makocolorcounter.cpp
Last active Feb 2, 2021
This simple example enumerates all the colors used in a PDF and reports on them.
View makocolorcounter.cpp
/*
* Copyright (C) 2013-2021 Global Graphics Software Ltd. All rights reserved
*
* Simple sample application for color reporting using the JawsMako APIs.
*/
#include <exception>
#include <iostream>
#include <jawsmako/jawsmako.h>
#include <jawsmako/pdfinput.h>
@mako-sdk
mako-sdk / MakoFontReporter.cpp
Last active Nov 19, 2020
Report on fonts present in a PDF. This version will work with Mako 5.2.2 and later
View MakoFontReporter.cpp
/*
* Copyright (C) 2013-2020 Global Graphics Software Ltd. All rights reserved
*
* Simple sample application for interrogating fonts using the JawsMako APIs.
*/
#include <exception>
#include <iostream>
#include <jawsmako/jawsmako.h>
#include <jawsmako/pdfinput.h>
#include <set>
View DrawEllipse.cs
// Draw an ellipse inside a rectangle using Bézier curves. Specify a square to draw a circle
static void DrawEllipse(IJawsMako jawsMako, ref IDOMFixedPage fixedPage, FRect rect,
double strokeThickness, IDOMBrush solidBrush)
{
// We can approximate a circle using four béziers. This is the parameter that is
// used for this purpose
double l = ((0.7071067812 - 0.5) * 8.0 / 3.0);
// And so we will offset the bézier control points by half that amount as the entire
// circle is one unit in diameter.