Created Date: Nov 06, 2020 14:18
Last Modifed Date: Nov 27, 2020 09:40

Introduction

The basic principles for rendering in Mako are straightforward, and are demonstrated in two of the simple examples (render and separatedrender) that ship with the Mako SDK. For example, rendering to RGB from a PDF or other input file involves these steps:


IJawsMakoPtr jawsMako = IJawsMako::create(".");
IJawsMako::enableAllFeatures(jawsMako);
CPP

IPDFInputPtr input = IPDFInput::create(jawsMako);
IDOMFixedPagePtr pageContent = input->open(pdfPath)->getDocument()->getPage(0)->getContent();
CPP

IJawsRendererPtr renderer = IJawsRenderer::create(jawsMako);
CPP

IDOMImagePtr renderedImage = renderer->render(pageContent);
CPP

IDOMPNGImage::encode(jawsMako, renderedImage, IOutputStream::createToFile(jawsMako, "rendered.png"));
CPP



IJawsMako jawsMako = IJawsMako.create(".");
IJawsMako.enableAllFeatures(jawsMako);
C#

var input = IPDFInput.create(jawsMako);
var pageContent = input.open(pdfPath).getDocument(0).getPage(0).getContent();
C#

var renderer = IJawsRenderer.create(jawsMako);
C#

var renderedImage = renderer.render(pageContent);
C#

IDOMPNGImage.encode(jawsMako, renderedImage, IOutputStream.createToFile(jawsMako.getFactory(), "rendered.png"));
C#