Knp Snappy Bundle Options - symfony

I'm using KnpSnappyBundle for my Symfony project and I'm trying to define some options in my config file. However if I set, for example:
knp_snappy:
pdf:
enabled: true
binary: /usr/local/bin/wkhtmltopdf
options: [ 'no-outline' ]
I get an error:
The option '0' does not exist.
How do I define options for the bundle?

Well, that was kinda dumb of me. YAML to the answer:
knp_snappy:
pdf:
enabled: true
binary: /usr/local/bin/wkhtmltopdf
options:
no-outline: true

The answer is:
knp_snappy:
pdf:
enabled: true
binary: /path/to/wkhtmltopdf
options:
- { name: 'page-size', value: 'A4' }

Related

How to specify a similiarities options checker of pylint in pre-commit args?

I've been trying to configure my pre-commit config file to ignore similiarities on imports and docstrings as described in: https://pylint.pycqa.org/en/latest/technical_reference/features.html?highlight=similar#similarities-checker-options
But I don't use any of .pylintrc files, just the .pre-commit-config.yaml.
Below is a snippet from .pre-commit-config.yaml
- id: pylint
name: pylint
entry: pylint
language: python
require_serial: true
types_or: [python, pyi]
exclude: 'kedro-init'
args: ['--disable=E0401,E1101,E1102,R0913,R0914,W0703,E0602,C0103,C0114,
W0102,C0330,C0326,W0107,R1716,R0902,E0611,E1124', '--fail-under=7.5',
'--ignore-imports=yes', '--ignore-docstrings=yes'] #this last line does not work
Is there any way to specify those options on the args key?
Thx!
python version: 3.8.x
pylint version: 2.12.3
If you retype your args in .pre-commit-config.yaml as below, it should work.
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: python
require_serial: true
types_or: [python, pyi]
exclude: 'kedro-init'
args: ["--ignore=E0401,E1101,E1102,R0913,R0914,W0703,E0602,C0103,
C0114, W0102,C0330,C0326,W0107,R1716,R0902,E0611,E1124",
"--fail-under=7.5"]

Command "generate-types" is not defined

I'm trying to generate types from the schema.yaml file, which I created
schema.yaml
types:
product:
properties:
name: {nullable: false}
description: {nullable: false}
image: { range: "Text"}
Offer:
properties:
url: {nullable: false}
price: {nullable: false, range: "Number"}
priceCurrency: {nullable: false}
Then when I execute the following command
vendor/bin/schema generate-types src/ config/schema.yaml
I will receive the following error:
Command "generate-types" is not defined
I tried to know what is the reason but I couldn't find it out.
Where can I defined the command: generate-types
My smfony version is 5.3
thanks a lot
See this changelog:
The generate-types command has been renamed generate
You need to change generate-types to generate.

Integrating Juno IDE with Atom editor for julia in windows

After having installed Atom and then integrating it with Juno IDE from here, i found this error shown at startup:-
Julia could not be found. We tried to launch Julia from: C:\Program Files\Julia-0.4.6\bin\julia.exe This path can be changed in the settings.
The installation path is correct. Then how to rectify this error?
ADDENDUM:
My config.cson file:
"*":
autosave:
enabled: true
core:
destroyEmptyPanes: false
openEmptyEditorOnStart: false
themes: [
"atom-dark-ui"
"atom-dark-syntax"
]
editor:
showIndentGuide: true
tabLength: 4
"exception-reporting":
userId: "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx"
"julia-client":
enableMenu: true
enableToolBar: true
juliaPath: "'C:\\Program Files\\Julia-0.4.6\\bin\\julia.exe'"
launchOnStartup: true
"tool-bar":
position: "Left"
"uber-juno":
disable: true
welcome:
showOnStartup: false

Error running wkhtmltopdf knp snappy bundle

I am using knp snappy bundle in symfony 2 ,when I tried this code below i get the error "The exit status code '127' says something went wrong:
stderr: "sh: 1: /usr/local/bin/wkhtmltopdf: not found
"
stdout: ""
command: /usr/local/bin/wkhtmltopdf --lowquality '/tmp/knp_snappy5730ffc6454157.04526188.html' '/tmp/knp_snappy5730ffc6454549.48294109.pdf'."
public function showtestAction()
{
$html = $this->renderView('CondorsTnMallBundle:SimpleVisitor:test.html.twig');
return new Response(
$this->get('knp_snappy.pdf')->getOutputFromHtml($html),
200,
array(
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'attachment; filename="file.pdf"'
)
);
}
The error message is quite clear: /usr/local/bin/wkhtmltopdf does not exist
First of all you need to know where wkhtmltopdf is in your filesystem. Then, you can add to your config.yml file these lines:
knp_snappy:
pdf:
enabled: true
binary: /real/path/to/your/file/wkhtmltopdf
options:
print-media-type: true
This works for me, just rename wkhtmltopdf-amd64 to wkhtmltopdf. Test older versions too.
knp_snappy:
pdf:
enabled: true
binary: /real/path/to/your/file/wkhtmltopdf
options:
print-media-type: true

Warning: Missing argument 1 for FM\ElFinderPHP\Connector\ElFinderConnector::run()

I'm working in a symfony project and I have a problem with browsing server in ckeditor for inserting images.
I'm using "Trsteel/ckeditor-bundle": "~1.8" and "helios-ag/fm-elfinder-bundle": "~4.0". When I try to browse the server to add image I have this error (Unable to connect to backend):
Warning: Missing argument 1 for
FM\ElFinderPHP\Connector\ElFinderConnector::run(), called in
C:\wamp\www\awb\vendor\helios-ag\fm-elfinder-bundle\Loader\ElFinderLoader.php
on line 63 and defined
Here is my config.yml:
trsteel_ckeditor: class: Trsteel\CkeditorBundle\Form\Type\CkeditorType
transformers: [] toolbar: ['document', 'clipboard', 'editing', '/',
'basicstyles', 'paragraph', 'links', '/', 'insert', 'styles', 'tools']
toolbar_groups: document: ['Source','-','Save','-','Templates']
clipboard:
['Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo']
editing: ['Find','Replace','-','SelectAll'] basicstyles:
['Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat']
paragraph:
['NumberedList','BulletedList','-','Outdent','Indent','-','JustifyLeft',
'JustifyCenter','JustifyRight','JustifyBlock'] links:
['Link','Unlink','Anchor'] insert:
['Image','Flash','Table','HorizontalRule'] styles: ['Styles','Format']
tools: ['Maximize', 'ShowBlocks'] ui_color: '#ffffff'
startup_outline_blocks: false width: 100% #Integer or % height: 300
Integer or % language: 'fr'
filebrowser_upload_url:
url: relative-url.php?type=file filebrowser_image_browse_url: route: elfinder route_parameters: instance: default
fm_elfinder: instances: default: locale: %locale% editor: ckeditor
fullscreen: true include_assets: true connector: debug: false roots:
uploads: show_hidden: false driver: LocalFileSystem path: uploads
upload_allow: ['image/png', 'image/jpg', 'image/jpeg'] upload_deny:
['all'] upload_max_size: 6M
Can someone help me please?
You should as suggested in the issues of fe-elfindeer to use the 5.0.5 version of ElFinderBundle who provides the 1st parameter to the ElFinderConnector::run() function.
Maybe you could try to edit your composer.json file as following :
"helios-ag/fm-elfinder-bundle": "~5.0",
"helios-ag/fm-elfinder-php-connector": "~2.3"
and run composer update helios-ag/fm-elfinder-bundle helios-ag/fm-elfinder-php-connector

Resources