Skip to main content
Skip table of contents

Configuring the underlying PDL

📌 Overview

This page describes a feature introduced in Mako 8.4.0 that makes it easier to configure IPSInput/IPRNInput.

This came about as a customer was attempting to generate rotated output for a couple of PostScript jobs using IPRNInput. The first used a %%ViewingOrientation DSC comment that indicated the desired rotation. The second lacked this comment, but could be auto rotated based on the dominant text direction in the job.

ℹ️ Key Concepts

  • The Jaws PostScript interpreter built into Mako will rotate a page based on DSC comments or dominant text orientation providing the /AutoRotatePages key is set

  • Until Mako 8.4.0, only the IDistiller (direct PostScript to PDF conversion) provided a means to apply this setting

  • A class introduced in Mako 8.4.0, IPRNInputPDLConfigurator allows users to configure the underlying PDL for IPSInput and IPRNInput

💪 Usage

Basic Usage

This code example shows how to configure IPRNInput to auto-rotate pages.

⌨️ Using IPRNInputPDLConfigurator

1. Add this class to create an instance

CPP
class CPdlConfigurator : public IPRNInputPDLConfigurator
{
  public:
    CPdlConfigurator(const bool autoRotatePages)
    {
        m_autoRotatePages = autoRotatePages;
    }

    void configure(const IInputPtr &input) override
    {
        IPSInputPtr psInput = obj2IPSInput(input);
        if (psInput)
        {
            IDistillerPtr distiller = psInput->getDistiller();
            distiller->setAutoRotatePages(m_autoRotatePages);
        }
    }

  private:
    bool m_autoRotatePages;
};

2. Usage

CPP
bool autoRotatePages = true;
CPdlConfigurator configurator(autoRotatePages);

PRNInputPtr prnInput = IPRNInput::create(jawsMako);
prnInput->setPdlConfigurator(&configurator);
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.