You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have added the code into the config.
But whenever i want to overrule some settings in the Controller::actionPdf as given in your example the settings don't change from the original ones.
e.g. if i set the orientation to "Landscape" when in the config the default is "Portrait".
Could it be that your Dependency Injection code doesn't work?
I would have to set it like this so that the settings are changed in the action.
public function actionPdf(){
Yii::$app->response->format = 'pdf';
Yii::$app->response->formatters['pdf']['orientation'] = 'Landscape';
Yii::$app->response->formatters['pdf']['format'] = [216, 356];
$this->layout = '//print';
return $this->render('myview', []);
}
Is this correct?
The text was updated successfully, but these errors were encountered:
i see that in the past there was also some issue with this code #10
Is there something wrong with this example or was something change within yii2 since 2015 so that the modifications to the attribute set over the container aren't used?
just to clarify:
I understand that there are changes to the mdf class itself. But my question is more why the changed attributes aren't taken over to when i just echo the orientation inside the class in the format function.
Of course i have enabled it. As i have written if i take your example code and change a setting e.g. marginLeft to another value as it is set in the config file (15=>45)
Hi I wanted to test your pdf formatter and have some issue with your given example code.
https://github.com/robregonm/yii2-pdf#usage
I have added the code into the config.
But whenever i want to overrule some settings in the Controller::actionPdf as given in your example the settings don't change from the original ones.
e.g. if i set the orientation to "Landscape" when in the config the default is "Portrait".
Could it be that your Dependency Injection code doesn't work?
I would have to set it like this so that the settings are changed in the action.
Is this correct?
The text was updated successfully, but these errors were encountered: