Coder Social home page Coder Social logo

Comments (2)

fulldecent avatar fulldecent commented on September 23, 2024

Reference for ParameterBag interface: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php

from mpdf.

Dasc3er avatar Dasc3er commented on September 23, 2024

I don't know if it may be useful, but a base for such a refactoring may be developed from the following structure (parsed from https://mpdf.github.io/reference/mpdf-variables/overview.html).

Click to show: Config.php

<?php

namespace Mpdf;

class Config
{
	// Paging
	/**
	 * The alias $useOddEven was used before v4.0.
	 * Scope: DOCUMENT.
	 * @since 4.0
	 */
	protected $mirrorMargins = 0;

	/**
	 * Removed v6.0.
	 * @since 2.3
	 */
	protected $restoreBlockPagebreaks = false;

	/**
	 * Scope: DOCUMENT.
	 * @since 2.3
	 */
	protected $forcePortraitMargins = false;

	/**
	 * Scope: DOCUMENT.
	 * @since 2.3
	 */
	protected $displayDefaultOrientation = false;

	/**
	 * Scope: DOCUMENT.
	 * @since 3.1
	 */
	protected $autoPageBreak = true;

	/**
	 * Scope: DOCUMENT.
	 * @since 4.0
	 */
	protected $setAutoTopMargin = false;

	/**
	 * Scope: DOCUMENT.
	 * @since 4.0
	 */
	protected $setAutoBottomMargin = false;

	/**
	 * Scope: DOCUMENT.
	 * @since 4.0
	 */
	protected $autoMarginPadding = 2;

	/**
	 * Allows an (empty) end of block to extend beyond the bottom margin by this amount (mm).
	 * Scope: DOCUMENT.
	 * @since 5.5
	 */
	protected $margBuffer = 2;

	/**
	 * Adds date and page info for printer when using @page and marks:crop;.
	 * @since 5.1
	 */
	protected $printers_info = false;

	/**
	 * @since 5.1
	 */
	protected $bleedMargin = 5;

	/**
	 * Distance of cross mark from margin in mm.
	 * @since 5.1
	 */
	protected $crossMarkMargin = 5;

	/**
	 * Distance of crop mark from margin in mm.
	 * @since 5.1
	 */
	protected $cropMarkMargin = 8;

	/**
	 * Default length in mm of crop line.
	 * @since 5.1
	 */
	protected $cropMarkLength = 18;

	/**
	 * Non-printable border at edge of paper sheet in mm.
	 * @since 5.1
	 */
	protected $nonPrintMargin = 8;

	/**
	 * for forced pagebreaks using <pagebreak />.
	 * @since 6.0
	 */
	protected $defaultPagebreakType = 'cloneall';

	// Page numbering
	/**
	 * NB The default value will not appear correctly in a PDF version of this page; it is substituted by the number of pages..
	 * Scope: DOCUMENT.
	 * @since
	 */
	protected $aliasNbPg = "{nb}";

	/**
	 * NB The default value will not appear correctly in a PDF version of this page; it is substituted by the number of pages..
	 * Scope: DOCUMENT.
	 * @since
	 */
	protected $aliasNbPgGp = "{nbpg}";

	/**
	 * Scope: DOCUMENT.
	 * @since 3.0
	 */
	protected $pagenumPrefix = "";

	/**
	 * Scope: DOCUMENT.
	 * @since 3.0
	 */
	protected $pagenumSuffix = "";

	/**
	 * Scope: DOCUMENT.
	 * @since 3.0
	 */
	protected $nbpgPrefix = "";

	/**
	 * Scope: DOCUMENT.
	 * @since 3.0
	 */
	protected $nbpgSuffix = "";

	/**
	 * Scope: DOCUMENT.
	 * @since 6.0
	 */
	protected $defaultPageNumStyle = "1";

	// Fonts, Languages and Character sets
	/**
	 * Control subsetting behaviour for fonts.
	 * Scope: DOCUMENT.
	 * @since 5.0
	 */
	protected $percentSubset = 30;

	/**
	 * Set to true to enable CSS support for font-kerning.
	 * Scope: DOCUMENT.
	 * @since 5.4
	 */
	protected $useKerning = false;

	/**
	 * Control subsetting behaviour for fonts.
	 * Scope: DOCUMENT.
	 * @since 5.0
	 */
	protected $maxTTFFilesize = 2000;

	protected $allow_charset_conversion = true;

	protected $charset_in = null;

	protected $biDirectional = false;

	/**
	 * @removed 5.0.
	 * @since
	 */
	protected $use_CJK_only = false;

	/**
	 * * You must only change this variable as a constructor parameter Use initial parameter to change at runtime e.g. $mpdf = new \Mpdf\Mpdf(['mode' => '+aCJK']);.
	 * Scope: DOCUMENT*.
	 * @since 5.0
	 */
	protected $useAdobeCJK = true;

	/**
	 * Removed in v6.0.
	 * @since 2.3
	 */
	protected $autoFontGroupSize = 2;

	/**
	 * Default value false before v4.0 Removed in v6.0.
	 * @since 2.3
	 */
	protected $useLang = true;

	/**
	 * Replaces SetAutoFont function.
	 * Scope: DOCUMENT.
	 * @since 6.0
	 */
	protected $autoScriptToLang = false;

	/**
	 * Replaces useLang.
	 * Scope: DOCUMENT.
	 * @since 6.0
	 */
	protected $autoLangToFont = false;

	/**
	 * Scope: DOCUMENT.
	 * @since 6.0
	 */
	protected $baseScript = 1;

	/**
	 * Scope: DOCUMENT.
	 * @since 6.0
	 */
	protected $autoArabic = false;

	/**
	 * Scope: DOCUMENT.
	 * @since 6.0
	 */
	protected $autoVietnamese = false;

	/**
	 * Removed in v6.0.
	 * @since 2.3
	 */
	protected $disableMultilingualJustify = false;

	/**
	 * Weight for bold text when using an artificial (outline) bold.
	 * @since 4.2
	 */
	protected $falseBoldWeight = 5;

	/**
	 * Factor of 1 to scale capital letters.
	 * @since 5.0
	 */
	protected $smCapsScale = 0.75;

	/**
	 * % to stretch small caps horizontally.
	 * @since 5.0
	 */
	protected $smCapsStretch = 115;

	/**
	 * Set as a font configuration variable.
	 * @since 5.0
	 */
	protected $backupSubsFont = array('dejavusanscondensed');

	/**
	 * Set as a font configuration variable.
	 * @since 5.0
	 */
	protected $backupSIPFont = '';

	// Configuration
	/**
	 * @removed 5.0 - Use $mpdf = new \Mpdf\Mpdf(['mode' => 'c']); The alias $use_embeddedfonts_1252 was used before v4.0.
	 * Scope: DOCUMENT.
	 * @since (3.0)
	 */
	protected $useOnlyCoreFonts = false;

	/**
	 * Scope: DOCUMENT.
	 * @since 5.2
	 */
	protected $repackageTTF = false;

	/**
	 * NB Altered behaviour mPDF ≥ 5.0 Default value true before v4.0.
	 * @since (4.0)
	 */
	protected $useSubstitutions = false;

	/**
	 * Removed in mPDF 5.0 Use useSusbstitutions instead. Substitute missing characters in UTF-8(multibyte) documents - from core fonts.
	 * @since 4.2
	 */
	protected $useSubstitutionsMB = false;

	/**
	 * Allows top and bottom margins to collapse between block elements.
	 * @since 4.2
	 */
	protected $collapseBlockMargins = true;

	/**
	 * Specifies size conversion for objects with size set by "px".
	 * @since 4.5
	 */
	protected $dpi = 96;

	/**
	 * Enable Imported PDF files (templates) [was mPDFI()] * You must only change this variable as a constructor parameter Use SetImportUse() to change at runtime..
	 * Scope: DOCUMENT*.
	 * @since 4.3
	 */
	protected $enableImports = false;

	/**
	 * Scope: DOCUMENT.
	 * @since 3.0
	 */
	protected $allow_output_buffering = false;

	/**
	 * Scope: DOCUMENT.
	 * @since
	 */
	protected $allow_html_optional_endtags = true;

	protected $ignore_invalid_utf8 = false;

	/**
	 * Scope: DOCUMENT.
	 * @since
	 */
	protected $text_input_as_HTML = false;

	/**
	 * Shows progress-bars whilst generating file * You must only change this variable as a constructor parameter key Use StartProgressBarOutput() to set at runtime..
	 * Scope: DOCUMENT*.
	 * @since 4.2
	 */
	protected $progressBar = false;

	/**
	 * Customise the use of progress-bars.
	 * Scope: DOCUMENT.
	 * @since 5.0
	 */
	protected $progbar_heading = "mPDF file progress";

	/**
	 * Customise the use of progress-bars.
	 * Scope: DOCUMENT.
	 * @since 5.0
	 */
	protected $progbar_altHTML = "";

	/**
	 * @since 4.2
	 */
	protected $incrementFPR1 = 10;

	/**
	 * @since 4.2
	 */
	protected $incrementFPR2 = 20;

	/**
	 * @since 4.2
	 */
	protected $incrementFPR3 = 30;

	/**
	 * @since 4.2
	 */
	protected $incrementFPR4 = 50;

	// Debugging
	/**
	 * Scope: DOCUMENT.
	 * @since 3.1
	 */
	protected $debug = false;

	/**
	 * Show errors and warning notes for fonts.
	 * Scope: DOCUMENT.
	 * @since 5.0
	 */
	protected $debugfonts = false;

	/**
	 * Scope: DOCUMENT.
	 * @since 3.0
	 */
	protected $showImageErrors = false;

	// PDF/A1-b, PDF/X-1a Colorspaces
	/**
	 * Scope: DOCUMENT.
	 * @since 4.3
	 */
	protected $PDFA = false;

	/**
	 * Scope: DOCUMENT.
	 * @since 4.3
	 */
	protected $PDFAauto = false;

	/**
	 * Scope: DOCUMENT.
	 * @since 5.1
	 */
	protected $PDFX = false;

	/**
	 * Scope: DOCUMENT.
	 * @since 5.1
	 */
	protected $PDFXauto = false;

	/**
	 * Scope: DOCUMENT.
	 * @since 4.3
	 */
	protected $ICCProfile = "";

	/**
	 * Scope: DOCUMENT.
	 * @since 5.1
	 */
	protected $restrictColorSpace = 0;

	// Annotations
	/**
	 * Scope: DOCUMENT.
	 * @since 2.2
	 */
	protected $title2annots = false;

	/**
	 * Scope: DOCUMENT.
	 * @since 2.2
	 */
	protected $annotMargin = null;

	/**
	 * Scope: DOCUMENT.
	 * @since 2.2
	 */
	protected $annotOpacity = 0.5;

	// Bookmarks (Outlines)
	/**
	 * Scope: DOCUMENT.
	 * @since
	 */
	protected $anchor2Bookmark = 0;

	/**
	 * Automatically generate bookmarks from Heading elements H1-H6.
	 * Scope: DOCUMENT.
	 * @since 5.7
	 */
	protected $h2bookmarks = array();

	/**
	 * Automatically generate ToC entries from Heading elements H1-H6.
	 * Scope: DOCUMENT.
	 * @since 5.7
	 */
	protected $h2toc = array();

	// CSS & Styles
	/**
	 * Scope: DOCUMENT.
	 * @since 4.4
	 */
	protected $CSSselectMedia = "print";

	/**
	 * @deprecated 4.4.
	 * Scope: DOCUMENT.
	 * @since
	 */
	protected $disablePrintCSS = null;

	/**
	 * Removed from v 5.1.
	 * Scope: DOCUMENT.
	 * @since
	 */
	protected $rtlCSS = 2;

	/**
	 * @deprecated 2.2.
	 * Scope: DOCUMENT.
	 * @since
	 */
	protected $useDefaultCSS2 = false;

	// Page Headers & Footers
	protected $defaultfooterfontsize = 8;
	protected $defaultfooterfontstyle = "BI";
	protected $defaultfooterline = 1;
	protected $defaultheaderfontsize = 8;
	protected $defaultheaderfontstyle = "BI";
	protected $defaultheaderline = 1;
	protected $footer_line_spacing = 0.25;
	protected $header_line_spacing = 0.25;

	/**
	 * Scope: DOCUMENT.
	 * @since
	 */
	protected $forcePortraitHeaders = false;

	/**
	 * @deprecated 4.0.
	 * Scope: DOCUMENT.
	 * @since
	 */
	protected $headerPageNoMarker = "!|";

	// Tables
	/**
	 * Scope: DOCUMENT.
	 * @since 4.3
	 */
	protected $simpleTables = false;

	/**
	 * Scope: DOCUMENT.
	 * @since 4.4
	 */
	protected $packTableData = false;

	/**
	 * Removed v6.0.
	 * Scope: DOCUMENT.
	 * @since 5.4
	 */
	protected $cacheTables = false;

	/**
	 * @since 4.6
	 */
	protected $tableMinSizePriority = false;

	/**
	 * @since 2.2
	 */
	protected $ignore_table_percents = false;

	/**
	 * @since 2.2
	 */
	protected $ignore_table_widths = false;

	/**
	 * @since 2.2
	 */
	protected $keep_table_proportions = false;
	protected $shrink_tables_to_fit = 1.4;
	protected $table_error_report = false;
	protected $table_error_report_param = "";

	/**
	 * @since 2.0
	 */
	protected $use_kwt = false;

	/**
	 * Enables the use of a replaceable iteration counter in table headers or footers.
	 * Scope: DOCUMENT.
	 * @since 5.0
	 */
	protected $iterationCounter = false;

	/**
	 * Array of characters enabled to align table columns.
	 * Scope: DOCUMENT.
	 * @since 5.7
	 */
	protected $decimal_align = "cf.";

	// Images
	protected $img_dpi = 96;

	// Text Spacing & Justification
	/**
	 * Value used for line-height when CSS specified as normal.
	 * @since 4.2
	 */
	protected $normalLineheight = 1.33;

	/**
	 * @since 6.0
	 */
	protected $useFixedNormalLineHeight = false;

	/**
	 * @since 6.0
	 */
	protected $useFixedTextBaseline = false;

	/**
	 * @since 6.0
	 */
	protected $adjustFontDescLineheight = 1.14;

	/**
	 * @since 5.1
	 */
	protected $jSmaxChar = 2;

	/**
	 * @since 5.1
	 */
	protected $jSmaxWordLast = 2;

	/**
	 * @since 5.1
	 */
	protected $jSmaxCharLast = 1;

	/**
	 * @deprecated 5.1.
	 * @since
	 */
	protected $jSpacing = null;
	protected $jSWord = 0.4;

	/**
	 * @removed 5.7
	 * @since
	 */
	protected $orphansAllowed = 5;

	/**
	 * Wrapping of CJK text.
	 * @since 5.2
	 */
	protected $allowCJKorphans = true;

	/**
	 * Wrapping of CJK text.
	 * @since 5.2
	 */
	protected $allowCJKoverflow = false;

	/**
	 * Wrapping of CJK text.
	 * @since 5.7
	 */
	protected $CJKforceend = false;

	/**
	 * @since 2.3
	 */
	protected $tabSpaces = 8;

	/**
	 * Justify the line before a <br> when using text-align: justify.
	 * @since 4.4
	 */
	protected $justifyB4br = false;

	// Hyphenation
	/**
	 * @removed 5.7
	 * @since 2.5
	 */
	protected $hyphenate = false;

	/**
	 * @removed 5.7
	 * @since 2.5
	 */
	protected $hyphenateTables = false;

	/**
	 * @since 2.5
	 */
	protected $SHYlang = "en";

	// Columns
	protected $keepColumns = false;

	protected $max_colH_correction = 1.15;

	// Lists
	/**
	 * @since 6.0
	 */
	protected $list_auto_mode = "browser";

	/**
	 * @since 6.0
	 */
	protected $list_indent_default = "40px";

	/**
	 * @since 6.0
	 */
	protected $list_indent_default_mpdf = "0em";

	/**
	 * @since 6.0
	 */
	protected $list_marker_offset = "5.5pt";

	/**
	 * @since 6.0
	 */
	protected $list_symbol_size = "3.6pt";

	/**
	 * @removed 6.0.
	 * @since 2.1
	 */
	protected $list_align_style = "R";
	protected $list_indent_first_level = 0;

	/**
	 * @since 2.1
	 */
	protected $list_number_suffix = ".";

	// Watermarks
	/**
	 * @since 2.2
	 */
	protected $showWatermarkImage = null;

	/**
	 * @since 2.2
	 */
	protected $showWatermarkText = null;
	protected $watermark_font = "";

	/**
	 * Can be changed by SetWatermarkImage().
	 * @since 2.2
	 */
	protected $watermarkImageAlpha = 0.2;

	/**
	 * @since 4.5
	 */
	protected $watermarkImgAlphaBlend = "Normal";

	/**
	 * Place watermark images behind page contents.
	 * @since 4.4
	 */
	protected $watermarkImgBehind = false;

	/**
	 * @since 2.2
	 */
	protected $watermarkTextAlpha = 0.2;

	// Borders
	/**
	 * Scope: DOCUMENT.
	 * @since 3.0
	 */
	protected $autoPadding = false;

	// Bookmarks

	/**
	 * Specify appearance of Bookmarks in PDF reader
	 * Scope: DOCUMENT.
	 * @since 5.4
	 */
	protected $bookmarkStyles = array();
}

from mpdf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.