Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Ferrum for PDF #547

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Use Ferrum for PDF #547

wants to merge 7 commits into from

Conversation

takahashim
Copy link
Collaborator

@takahashim takahashim commented Jul 31, 2023

🎩 What? Why?

SurveyでPDF出力をする際、wicked_pdf(が依存しているwkhtmltopdf-binary gem)の代わりにheadless chrome + Ferrum gemを使ってPDFを生成するよう変更します。

FerrumChrome DevTools Protocolを使ってChromeやChromiumを制御するためのgemです。
そのためのChromeは別途インストールする必要があります(distributionの標準パッケージ的なものがあればそれを使えばよいはず)。

📌 Related Issues

📋 Subtasks

  • Add CHANGELOG upgrade notes, if required
  • If there's a new public field, add it to GraphQL API
  • Add documentation regarding the feature
  • Add/modify seeds
  • Add tests
  • Another subtask

📷 Screenshots (optional)

Original

wicked_pdf

Ferrum

(デフォルトのフォントサイズが違う?→少し調整しました)

ferrum2

@takahashim takahashim marked this pull request as ready for review July 31, 2023 11:01
@ayuki-joto ayuki-joto changed the base branch from develop to main November 9, 2023 12:11
@takahashim
Copy link
Collaborator Author

rebaseしました

@takahashim
Copy link
Collaborator Author

[ActiveJob] [Decidim::ExportJob] [b204801d-fc36-4d37-824e-8f1221d31c86] Error performing Decidim::ExportJob (Job ID: b204801d-fc36-4d37-824e-8f1221d31c86) from Async(exports) in 53.12ms: ActionView::Template::Error (uninitialized constant QuestionnaireAnswerPresenter):

みたいなエラーが出ていそう…

@ayuki-joto
Copy link
Collaborator

[ActiveJob] [Decidim::ExportJob] [80b0c055-9347-4954-8203-bd34447f884d] Error performing Decidim::ExportJob (Job ID: 80b0c055-9347-4954-8203-bd34447f884d) from Async(exports) in 14480.43ms: NoMethodError (undefined method `first' for nil:NilClass):

僕の方ではこのエラーが出ますね

@takahashim
Copy link
Collaborator Author

私の方では 3a8b042 の修正でエラーが治るようでした。

@takahashim
Copy link
Collaborator Author

#547 (comment)nilになってるのは回答がうまく溜まってないせいかと思ったんですが、普通に回答が0件の場合だとそもそもexportができないので再現しないようでした…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants