Example usage for com.lowagie.text.pdf PdfName PRINTSCALING

List of usage examples for com.lowagie.text.pdf PdfName PRINTSCALING

Introduction

In this page you can find the example usage for com.lowagie.text.pdf PdfName PRINTSCALING.

Prototype

PdfName PRINTSCALING

To view the source code for com.lowagie.text.pdf PdfName PRINTSCALING.

Click Source Link

Document

A name

Usage

From source file:org.sejda.impl.itext.ViewerPreferencesTask.java

License:Apache License

/**
 * //from   www .ja va 2  s.  c  om
 * @param parameters
 * @return a map of preferences with corresponding value to be set on the documents
 */
private Map<PdfName, PdfObject> getConfiguredViewerPreferencesMap(ViewerPreferencesParameters parameters) {
    Map<PdfName, PdfObject> confPreferences = new HashMap<PdfName, PdfObject>();
    if (parameters.getDirection() != null) {
        confPreferences.put(PdfName.DIRECTION, ViewerPreferencesUtils.getDirection(parameters.getDirection()));
    }
    if (parameters.getDuplex() != null) {
        confPreferences.put(PdfName.DUPLEX, ViewerPreferencesUtils.getDuplex(parameters.getDuplex()));
    }
    if (parameters.getPrintScaling() != null) {
        confPreferences.put(PdfName.PRINTSCALING,
                ViewerPreferencesUtils.getPrintScaling(parameters.getPrintScaling()));
    }
    confPreferences.put(PdfName.NONFULLSCREENPAGEMODE,
            ViewerPreferencesUtils.getNFSMode(parameters.getNfsMode()));

    Set<PdfBooleanPreference> activePref = parameters.getEnabledPreferences();
    for (PdfBooleanPreference boolPref : PdfBooleanPreference.values()) {
        if (activePref.contains(boolPref)) {
            confPreferences.put(ViewerPreferencesUtils.getBooleanPreference(boolPref), PdfBoolean.PDFTRUE);
        } else {
            confPreferences.put(ViewerPreferencesUtils.getBooleanPreference(boolPref), PdfBoolean.PDFFALSE);
        }
    }
    return confPreferences;
}