OpenSlides / openslides-client

Webclient for OpenSlides 4+
MIT License
3 stars 33 forks source link

issue with headings (pdf export and OpenSlides formatting doesn't match) #2118

Open MSoeb opened 1 year ago

MSoeb commented 1 year ago

Description: The formatting of headings is not identical in OpenSlides and in exported PDF documents.

Openslides formatting: Screenshot_20230323_130928

PDF export formatting: Screenshot_20230323_131532

Reproduction:

  1. create a motion
  2. add headings in motion text or reason field
  3. create pdf export and compare the formatting

What should happen: The formatting should be identical between OpenSlides text edit and pdf export.

Update 28.10.2024: Please take care of the comment, what has changed with the new editor.

luisa-beerboom commented 1 year ago

The base html-to-pdf.service.ts in the client that is responsible for this translation is supposed to be a more generic type of class with no specific OpenSlides functionality. It therefore wouldn't be very appropriate to change the element styles to fit the OpenSlides-specific styles, however I think it would be possible to add the ability to define a set of custom styles when calling the convertHtml function.

In that case we could define a global constant with style definitions that result in the above, that can be imported and given to the function as needed (named something like OPENSLIDES_PDFMAKE_STYLES)

luisa-beerboom commented 1 year ago

In that case we could define a global constant with style definitions that result in the above, that can be imported and given to the function as needed (named something like OPENSLIDES_PDFMAKE_STYLES)

On second thought, since in Openslides h1 always has the accent color of the current theme, it should probably not a constant and we should define a getter function in some common service that accesses the theme

jsangmeister commented 1 year ago

From my naive perspective, it looks like the styles are defined in https://github.com/OpenSlides/openslides-client/blob/78cf482ef2dfbef592b9fd53a6cd43708a73d354/client/src/app/gateways/export/html-to-pdf.service/html-to-pdf.service.ts#L59-L64 and could just be adapted to a dynamic parameter based on the current style.

Eich-hoernchen commented 1 year ago

if the pdf is shown in the current style, it will be better for the user to orient himself in the pdf while reading because it is the same layout like openslides then

MSoeb commented 2 weeks ago

The layout of the headings changed with the integration of the new editor. Here is the new difference between headings in the motion and the export:

Motion headings: image

PDF headings: image