Skip to content

Instantly share code, notes, and snippets.

Avatar

Mako SDK mako-sdk

View GitHub Profile
@mako-sdk
mako-sdk / pdfuacreation.cpp
Created Apr 29, 2022
This example is primarily intended to demonstrate tagging of content for accessibility, creating a PDF/UA PDF document in the process. In doing so it also is a good example of how to create a document with Mako from scratch, adding images, text and tables. The working example is included in the Mako SDK in the simpleexamples folder.
View pdfuacreation.cpp
/*
* Copyright (C) 2022 Global Graphics Software Ltd. All rights reserved.
*
* A simple, but growing, selection of examples for certain JawsMako functionality.
*
* A simple example of generating content and tagging to create a PDF/UA (Accessible) PDF.
*/
#include <iostream>
#include <jawsmako/jawsmako.h>
@mako-sdk
mako-sdk / PageLabelExample.cpp
Created Apr 27, 2022
Mako example demonstrating setting page labels. It requires an input PDF or at least 250 pages.
View PageLabelExample.cpp
// -----------------------------------------------------------------------
// <copyright file="PageLabelExample.cpp" company="Global Graphics Software Ltd">
// Copyright (c) 2022 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.
//
// Simple sample application for converting text to outlines using the JawsMako APIs.
View MakoImage2PDF
/* -----------------------------------------------------------------------------------
* <copyright file="MakoImage2PDF.cpp" company="Global Graphics Software Ltd">
* Copyright (c) 2022 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.
*
* Simple sample application to load an image into a new PDF using the Mako APIs.
@mako-sdk
mako-sdk / MakoImageExtract.cs
Created Dec 7, 2021
C# example to extract images from a PDF
View MakoImageExtract.cs
/* -----------------------------------------------------------------------
* <copyright file="makoimageextract.cs" 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 / 1_XamlToMakoDom.cs
Last active Nov 17, 2021
XAML WPF Canvas conversion to Mako DOM, leveraging the Abbreviated Geometry Syntax support introduced in Mako 6.3.0
View 1_XamlToMakoDom.cs
/* --------------------------------------------------------------------------------
* <copyright file="XamlToMakoDom.cs" 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 / StreamingExample.cs
Created Oct 28, 2021
This C# example demonstrates the use of callbacks to manage stream I/O.
View StreamingExample.cs
using System;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using JawsMako;
namespace StreamingExamples
{
static class Program
{
@mako-sdk
mako-sdk / RetargetRenderingIntent.cpp
Created Jul 23, 2021
Mako sample that uses a custom transform to update the rendering intent property on DOM nodes
View RetargetRenderingIntent.cpp
// <copyright file="RetargetRenderingIntent.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 / applyPageRotation.cpp
Created Jun 9, 2021
Creates a IDOMFixedPage from an IPage, rotating content and cropbox as needed
View applyPageRotation.cpp
// Create a IDOMFixedPage from an IPage, rotating content and cropbox as needed
static bool applyPageRotation(IJawsMakoPtr jawsMako, IPagePtr page, IDOMFixedPagePtr& fixedPage, FRect& cropBox)
{
if (!page)
return false;
// Does the page have crop margins?
// Note: page->getCropBox() will return the cropbox dimensions if set, or the mediabox (absolute page size) dimensions if not
// A fixedPage() does not offer this guarantee, so fixedPage->getCropBox() may return an empty FRect() (ie one or more values < 0)
cropBox = page->getCropBox();
@mako-sdk
mako-sdk / TestFrameWriter.cpp
Created May 15, 2021
Create an image from scratch by writing values to a buffer then use IImageFrameWriter to generate an IDOMImage that can be be saved to disk
View TestFrameWriter.cpp
// -----------------------------------------------------------------------
// <copyright file="TestFrameWriter.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>
// -----------------------------------------------------------------------
View makoobjsep.cpp
/*
* Copyright (C) 2013-2021 Global Graphics Software Ltd. All rights reserved
*
* Simple sample application for object-based separations using the JawsMako APIs.
*/
#include <algorithm>
#include <exception>
#include <iostream>
#include <stdexcept>