enketo / enketo

Enketo web forms monorepo
Apache License 2.0
15 stars 29 forks source link

Differences between Enketo preview and Downloaded pdf. #142

Open kkrawczyk123 opened 4 years ago

kkrawczyk123 commented 4 years ago

Describe the bug When I was testing Central and Enketo integration I have noticed differences between preview and downloaded pdf. It is probably connected to widget types. I will attach screenshots as examples.

To Reproduce I have uses All widgets forms.

  1. Open All widgets form in Enketo preview
  2. Download pdf file
  3. Compare both displays
  4. Fill some answers in Enketo preview
  5. Download pdf file
  6. Compare both displays

Expected behavior I feel like preview mode and downloaded pdf should be as close to each other as possible.

Screenshots range widgets: Preview: Download:
Screenshot from 2020-07-21 08-51-37 Screenshot from 2020-07-21 08-52-15
Preview: Download:
Screenshot from 2020-07-21 08-54-17 Screenshot from 2020-07-21 08-54-53
rating widget: Preview: Download:
Screenshot from 2020-07-21 08-57-23 Screenshot from 2020-07-21 08-57-41

Browser and OS (please complete the following information):

MartijnR commented 4 years ago

Thanks!

FrankApiyo commented 4 years ago

@MartijnR I'd like to try to fix this

MartijnR commented 4 years ago

Great! You can work on this on screen (instead of creating a PDF) in enketo-core. Enketo Express runs a headless Chrome browser to create a PDF (as in printing from a browser).

To switch to printview do printview(true) in the console, and to switch back do printView(false) (these functions are just helper functions for developers working in enketo-core - you can find them in app.js).

It's always good to also check the Grid theme because it's quite different from other themes. To do this:

  1. comment out the 2 formhub css lines in build/index.html and uncomment the 2 grid css lines
  2. instead of the above commands do printGridView(true) and printGridView(false).