View Source Changelog
1-17-0-2024-08-09
[1.17.0] - 2024-08-09
changed
Changed
- Some of the types have been renamed, e.g.
ChromicPDF.export_optiontoshared_option.
fixed
Fixed
- Small fix
:chrome_versionconfig switch allowing to passChrome x.y.z.zzinstead of justx.y.z.zz
added
Added
- Support custom protocols through
:protocoloption onprint_to_pdf/2andcapture_screenshot, as well as newChromicPDF.run_protocol/2function. These features are considered internal API.
1-16-1-2024-07-25
[1.16.1] - 2024-07-25
added-1
Added
- Extend
chrome_argsto allow removal of conflicting default args. Allows for use cases which were previously blocked by defaults such as rendering WebGL images. See #314 (@walter)
1-16-0-2024-06-25
[1.16.0] - 2024-06-25
changed-1
Changed
- Removed the
-dCompatibilityLevel=1.4default switch from the ghostscript processor. Ghostscript has defaulted to to 1.7 for a long time now and we have been keeping this flag since GS 9.xx which likely not many people are using anymore. If anyone needs it, a new:compatibility_leveloption can used to set it back to 1.4.
1-15-2-2024-01-04
[1.15.2] - 2024-01-04
changed-2
Changed
- Expand
phoenix_htmldependency to include version 4 (@idabmat)
1-15-1-2023-12-18
[1.15.1] - 2023-12-18
fixed-1
Fixed
- Explicitly pick keys in
ChromicPDF.Templateto fix Dialyzer "no local return" errors in clients.
1-15-0-2023-12-15
[1.15.0] - 2023-12-15
fixed-2
Fixed
- Recover missing custom footer templates by making sure we do not add any
@pageCSS rule to the header or footer templates inChromicPDF.Template.source_and_options/1. (#290) - Drop the default
zoom: 0.75rule from header and footer templates for Chrome >= v120. They removed the default scale-up by 4/3, see chromium bug #1509917.
Note that for remote chrome users this means they will have to explicitly specify the chrome version in the application config.
config :chromic_pdf, chrome_version: "Google Chrome 120.0.6099.71"
added-2
Added
- Add
ChromicPDF.Plugto forward Chrome requests on an internal endpoint to a template. - Add
Template.options/1that returns the options for page dimensions, header, and footer, but does not require the content.
changed-3
Changed
- Drop
-dNEWPDF=falseswitch from Ghostscript >= 10.2. The old PDF interpreter has been removed and using the switch results in a warning now. - Split
Chromic.Template.styles/1intopage_styles/1andheader_footer_styles/1, and trim the stylesheets. - Cookies set via
:set_cookieare nowhttpOnly: trueby default.
removed
Removed
- Dropped the outdated Phoenix example in
examples/. - Deprecated
ChromicPDF.styles/1.
1-14-0-2023-09-27
[1.14.0] - 2023-09-27
added-3
Added
- Configurable pool checkout timeout via new global option
:checkout_timeout.
1-13-0-2023-08-17
[1.13.0] - 2023-08-17
added-4
Added
- Add support for named session pools. These can be used to give persistent session options (
offline,disable_scripts, ...) different values, for example to have one template that is not allowed to execute JavaScript and while others can use JavaScript.
changed-4
Changed
- Deprecate
:max_session_usesoption in favor ofsession_pool: [max_uses: ...]. - Drop
--no-zygotecommand line switch when usingno_sandbox: trueoption. The switch causes session crashes in recent Chrome versions and was never needed for--no-sandboxin the first place. See #270.
⚠️ In case you are using no_sandbox: true, dropping --no-zygote means Chrome will spawn an additional OS process (the "zygote" process), which could be considered a break of backwards compatibility. Please monitor your next deployment. However, we believe this change is safe, meaning except for the additional process, it will not be noticable. Hence we concluded to drop the switch without a major version bump, in order not to disturb too many people. If you are not using :no_sandbox, this does not affect you.
1-12-0-2023-07-12
[1.12.0] - 2023-07-12
added-5
Added
- Add
:console_api_callsoption to configure handling ofconsole.foocalls in JS runtime (ignore, log, raise). - Document fixes for font rendering issues, and give
ChromicPDF.Templateatext_renderingoption to allow applyingtext-rendering: geometricPrecision;on all elements.
1-11-0-2023-06-19
[1.11.0] - 2023-06-19
added-6
Added
- Add experimental support for connecting to running chrome instances via inet-based debugging (usually on port 9222). Controlled by option
:chrome_address. Requires optionalwebsockexdependency.
fixed-3
Fixed
- Add
--hide-scrollbarsto default command line options, to hide scrollbars on screenshots.
1-10-0-2023-06-09
[1.10.0] - 2023-06-09
added-7
Added
- Add
:full_pageoption toChromicPDF.capture_screenshot/2to increase the viewport size to match the content.
1-9-1-2023-06-08
[1.9.1] - 2023-06-08
fixed-4
Fixed
- Handle
ChromicPDF.Template.source_and_options/1tuples inChromicPDF.capture_screenshot/2.
1-9-0-2023-05-02
[1.9.0] - 2023-05-02
added-8
Added
- Error handling for call responses in protocol steps, e.g. invalid options for printToPDF. (@tonnenpinguin)
1-8-1-2023-04-20
[1.8.1] - 2023-04-20
- Allow
nimble_pool1.0.
1-8-0-2023-04-04
[1.8.0] - 2023-04-04
added-9
Added
- Add
unhandled_runtime_exceptionsoption that allows to raise on unhandled JavaScript exceptions in templates. Default to warn about them in log.
changed-5
Changed
- Simplified
on_demandmode. Instead of spawning the entire supervision tree temporarily, we now only spawn theBrowserprocess. Also instead of giving the normalChromicPDFname to the temporary supervisor, which effectively prevented concurrent access to ChromicPDF when configured withon_demand: true, the temporaryBrowserprocess remains anonymous.
1-7-0-2023-02-17
[1.7.0] - 2023-02-17
added-10
Added
- Add
ChromicPDF.put_dynamic_name/1andnameoption toChromicPDF.Supervisor.start_link/2for dynamic process names. (@dvic)
fixed-5
Fixed
- Handle
DOWNreason inSessionPool.terminate_worker/3callback. Fixes #219.
1-6-0-2023-01-12
[1.6.0] - 2023-01-12
fixed-6
Fixed
- Filename quoting (like
-sOutputFile="/some/path") doesn't work anymore in GS 9.56+. Dropped as we didn't need it anyway. GS 9.56 and 10.0 are supported now.
added-11
Added
- Add
permit_readoption toconvert_to_pdfa/2andprint_to_pdfa/2to allow adding user-provided--permit-file-readoptions.
changed-6
Changed
- Removed unnecessary Ghostscript step to embed fonts. Instead, the relevant arguments are now part of our default set of
pdfwritearguments, and hence are also applied to the PDF concatenation added in 1.5.0. - Made PDF concatenation take into account
SAFERmode.
1-5-0-2022-12-22
[1.5.0] - 2022-12-22
added-12
Added
- Add automatic PDF concatenation when passing a list to
print_to_pdf/2orprint_to_pdfa/2. (@xaviRodri) - Add
warm_up/1to allow one-off launches of the Chrome executable with our default arguments, to mitigate random CI failures on Github Actions.
1-4-0-2022-12-07
[1.4.0] - 2022-12-07
added-13
Added
- Add error details on failure to checkout worker from pool.
- Add a whole list of new default command line options following Puppeteer's example.
changed-7
Changed
wait_forandevaluateoptions can now be combined, as thewait_forscript is appended to the user-givenevaluateexpression.
fixed-7
Fixed
- Make sure to close a browser target when the worker in the pool is terminated. Previously, when a worker was terminated due to an exception (e.g. the timeout error), the target wasn't cleaned up, potentially leading to memory exhaustion.
- Actually inspect the current state of the protocol in the timeout exception, instead of the (pretty useless) initial parameter.
- Make sure the
inspectorCrashedwarning is only printed once.
1-3-1-2022-11-08
[1.3.1] - 2022-11-08
changed-8
Changed
- Included the inspected
ChromicPDF.Protocolin the timeout exception to improve debugging. - Bump jason to 1.3
- Bump telemetry to 1.1
- Updated dev dependencies
1-3-0-2022-09-27
[1.3.0] - 2022-09-27
added-14
Added
- Add
disable_scriptsglobal option. (@MaeIsBad) - Add error details about potential shared memory exhaustion. (@WilliamVenner)
1-2-2-2022-07-18
[1.2.2] - 2022-07-18
fixed-8
Fixed
- Use old pdf interpreter with ghostscript > 9.56 to avoid segfaults (see #158)
1-2-1-2022-07-12
[1.2.1] - 2022-07-12
fixed-9
Fixed
- Incompatibility with ghostscript 9.56.1 (fixes #153)
- Added search paths for chrome executable (fixes #151)
1-2-0-2022-03-17
[1.2.0] - 2022-03-17
added-15
Added
- Improved docs on header/footer templates saying that external URLs don't work.
- Added a logger call when we receive the
Inspector.targetCrashedmessage, so users can tell that their Chrome target has died for some reason. - Add more paper sizes to
ChromicPDF.Template. (@williamthome) - Add
:landscapeoption toChromicPDF.Template. (@williamthome) - Add
:init_timeoutoption toChromicPDF.Browser.SessionPool. (@dvic)
1-1-2-2021-10-27
[1.1.2] - 2021-10-27
fixed-10
Fixed
- Documentation updates (@kianmeng)
1-1-1-2021-09-24
[1.1.1] - 2021-09-24
added-16
Added
- Relaxed telemetry dependency to avoid blocking dependency update (@leandrocp)
- Add chromium path on macOS when installed via homebrew (@shamanime)
1-1-0-2021-04-16
[1.1.0] - 2021-04-16
changed-9
Changed
- Improved error message when Chrome dies at startup.
- Improved docs on the
no_sandboxoption.
added-17
Added
- Added
chrome_executableoption to allow specifying path to chrome executable.
1-0-0-2021-03-23
[1.0.0] - 2021-03-23
added-18
Added
- Added
evaluateoption to run client-side scripts before printing. - Added a few options (
evaluate,set_cookie,wait_for) tocapture_screenshot/2.
changed-10
Changed
- Reimplemented
wait_foroption based on a JS script and theevaluateoption to overcome race condition issues of original solution. Behaviour remains the same.
0-7-2-2021-02-26
[0.7.2] - 2021-02-26
fixed-11
Fixed
- Enforced telemetry version 0.4.2 (fixes #108)
0-7-1-2021-02-08
[0.7.1] - 2021-02-08
fixed-12
Fixed
- To determine the session pool / ghostscript pool size, if not specified in the options, we now fetch the number of schedulers at runtime, not compile time. Makes more sense. We also set a minimum of 1 in case there is only 1 scheduler online.
0-7-0-2021-01-25
[0.7.0] - 2021-01-25
added-19
Added
- Added option
wait_forto wait for DOM element attribute to be set dynamically. (@jarimatti) - New global
timeoutoption for session pool allows to configure timeout of print processes. - New global
ignore_certificate_errorsoption allows to bypass SSL certificate verification. - New global
chrome_argsoption allows to pass custom flags to chrome command.
0-6-2-2020-12-28
[0.6.2] - 2020-12-28
fixed-13
Fixed
- When sending HTML to Chrome with
{:html, <content>}, wait for thePage.loadEventFirednotification to allow external resources (images, scripts, ...) to be fetched. (#80)
0-6-1-2020-11-17
[0.6.1] - 2020-11-17
fixed-14
Fixed
- Reverted to file descriptor redirection to mitigate weird Port behaviour (#76).
0-6-0-2020-11-16
[0.6.0] - 2020-11-16
changed-11
Changed
- Elixir version housekeeping. Fixed a warning on Elixir 1.11 by adding
:eexto:extra_applications. ChromicPDF now requires Elixir >= 1.10 for its use ofApplication.compile_env/3. - Dropped
poolboyin favour ofnimble_pool. This renders themax_overflowpoolboy option without effect. - Made "online mode" the default. Chrome will resolve all URL references unless the global
option
offline: falseis set.
added-20
Added
- Added telemetry events for the PDF generation & PDF/A conversion.
- "On Demand" mode allows to start & stop Chrome as needed, much like puppeteer does. This helps in development to prevent leaving behind zombie processes when the BEAM is aborted with Ctrl+C.
- New global option
discard_stderrallows to enable Chrome's stderr logging which is by default piped to/dev/null.
fixed-15
Fixed
- Graceful shutdown is now actually graceful in that it waits for Chrome to clean up the debugging sessions and close the pipe on its end.
0-5-2-2020-07-17
[0.5.2] - 2020-07-17
fixed-16
Fixed
- Moved static files required for PDF/A generation to /priv so they are embedded into releases.
- Moved logo files out of /priv so they are not included in releases.
0-5-1-2020-07-10
[0.5.1] - 2020-07-10
fixed-17
Fixed
- Fixed typespecs for
Template.source_and_options/1.[content_option]weren't allowed as call tostyles/1narrowed type to[style_option]. - Added missing keys to
style_option.
0-5-0-2020-07-10
[0.5.0] - 2020-07-10
changed-12
Changed
- Removed the
:widthand:heightoptions fromTemplate.styles/1andTemplate.source_and_options/1as it turns out that Chrome does not pay attention to@pagedimensions and instead still sets the size of the produced PDF to US letter. Since it does not seem possible to the PDF size in Chrome headless besides using thepaperWidthandpaperHeightoptions, moved to a:sizeoption instead that accepts names like:a4,:us_letter, and tuples of{<width>, <height>}in inches. These are then passed topaperWidthandpaperHeight. - Ditched the
preferCssPageSizeoption fromTemplate.source_and_options/1as it did not seem to have any effect. See above.
added-21
Added
- Added
zoom: 0.75to both#headerand#footerin the template as this seems to be exactly what is needed to reverse the viewport scaling that Chrome uses on them by default. With this, headers & footers and the content can use the same CSS styles. - Included
-webkit-print-color-adjust: exactrule to template sobackground-colorrules are enabled by default.
fixed-18
Fixed
- Make
print_to_pdfa/2actually acceptsource_and_options()map fromTemplate.
0-4-0-2020-07-09
[0.4.0] - 2020-07-09
added-22
Added
- Allow
{:url, <path>}input tuples where path is only a path, and not afile://URL.
changed-13
Changed
- When passing a function to the
:outputparameter, the function result will now be returned as part of theprint_to_pdf& friends result as{:ok, <callback_result>}instead of:ok.
0-3-1-2020-04-09
[0.3.1] - 2020-04-09
added-23
Added
- Handle
{:safe, iolist()}tuples in API and Template (for content coming from Phoenix.View). ExposeTemplate.html_concatas potentially useful helper. - Reset navigation history after each print job to avoid leaking information.
- Create new empty browser context for each target (similar to incognito tab).
- Restart browser target after a maximum number of PDFs have been printed to avoid memory bloat.
changed-14
Changed
- Set user agent to custom string.
- Default number of sessions in pool to half the number of available cores.
0-3-0-2020-03-30
[0.3.0] - 2020-03-30
added-24
Added
- HTML source and header and footer template accept iolists now
- New
Templatemodule contains basic CSS skeleton to easily dimension & layout pages (header & footer margins)
0-2-0-2020-03-06
[0.2.0] - 2020-03-06
added-25
Added
- Add
set_cookieoption toprint_to_pdf/2. - Targets now navigate to
about:blankafter PDF prints. - Fixed the temporary file yielding way of calling
print_to_pdf/2.
0-1-0-2020-03-02
[0.1.0] - 2020-03-02
added-26
Added
- First release to hex.pm