【问题标题】:Printing PDFs with Puppeteer/Playwright and Flexbox LayoutsPrinting PDFs with Puppeteer/Playwright and Flexbox Layouts
【发布时间】:2022-12-16 16:31:55
【问题描述】:

If you open Chrome or Edge and visit a page with a flexbox layout, like this one, and choose Print/Save as PDF, the PDF includes the flex elements in the proper location. However, if you use Playwright and the Page object's pdf() method, flex elements are missing.

I'm fairly certain this isn't a bug with Playwright, or Puppeteer, but instead is an issue with how the headless chromium creates the pdf. Or, hopefully, it's some kind of option I'm missing somewhere. Does anyone have experience creating PDFs of pages with flexbox layouts using Playwright?

【问题讨论】:

    标签: pdf flexbox puppeteer playwright


    【解决方案1】:

    我有一个类似的问题,我的 flexbox 中元素的高度在 Puppeteer 中是完全错误的。

    I was able to solve it by using display: inline-flex instead of display: flex

    【讨论】:

      猜你喜欢
      • 2022-12-01
      • 2022-12-01
      • 2015-09-01
      • 2017-11-02
      • 2020-11-29
      • 2013-01-03
      • 2021-12-27
      • 2022-11-13
      • 1970-01-01
      相关资源
      最近更新 更多