Closed (fixed)
Project:
PDF using mPDF8
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Jul 2019 at 12:18 UTC
Updated:
18 May 2020 at 11:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
Adon Irani commentedNot sure if this is the best way... but this is what i did:
in ConvertToPdfInterface.pdf
- function convert($html);
+ function convert($html,$override_settings);
in ConverttoPdf.php
- public function convert($html) {
- $this->settings = $this->getConfigValues();
+ public function convert($html,$override_settings) {
+ $this->settings = $this->getConfigValues();
+ if( !empty( $override_settings )) {
+ foreach( $override_settings as $key=>$value ) {
+ if( !empty( $this->settings[$key] )) $this->settings[$key] = $value;
+ }
+ }
You can then pass an array of settings to override (using the variables set in AdminSettingsForm.php)
If OK by product maintainer, I'd be happy to submit a patch.
Comment #3
samaphpThank you @Adon Irani,
I ended up using the MPDF library directly.
But I would love if you can create this patch so we can help the maintainer and test it to make it ready to be implemented in the next releases.
Thanks!
Comment #4
gauravjeet commentedThank you Adon Irani. Please submit a match.
Comment #5
Adon Irani commentedApologies for the delay. Here is the patch.
To use: simply pass an array to the convert function with the desired settings to override, e.g. convert( $html, $override_settings ) where $override_settings["margin_top"] = "100";
Comment #6
gauravjeet commentedThis has been fixed in v2.1 of this module already!
Note:
This module space is deprecated and no more support will be given here. I'm going to close this issue and please do not re-open this here as the code been moved to the original project. Please refer the original project here pdf_using_mpdf version 8.x-2.1 for latest version of this module.