Content dissapearing for unknown reasons #25

Closed
opened 12 months ago by decentral1se · 12 comments
Collaborator

Veryyy mysteriously, lines and whole paragraphs get eaten by some part of the generation process. Everything looks perfect until the moment have you have downloaded the print pdf and then you notice content is chopped off. I guess this must have happened to you @simoon @mb?

One example I have which is not great is that a URL is just... not there 🙃

image

It appears to be only happening on page breaks. And only in Google Chrome. I have tried removing / adding alot of stuff but can't quite seem to track it down. It's happening sometimes but also it's hard to track down.

It's kinda more of just an anxiety bug because I don't know if my sentences are gone are not and I easily miss them on a close read. Plus you have to generate it first and then perhaps even print it to get a good look.

Any work-arounds? Any fixes?

Thoughts welcome! Nonetheless enjoying octomode / may 1rst energy 🖤

I'm working from https://octomode.vvvvvvaria.org/anarcho-krant-mvp-issue-1/pad/

Thanks!

Veryyy mysteriously, lines and whole paragraphs get eaten by some part of the generation process. Everything looks perfect until the moment have you have downloaded the print pdf and then you notice content is chopped off. I guess this must have happened to you @simoon @mb? One example I have which is not great is that a URL is just... not there 🙃 ![image](/attachments/f87511c3-4e40-4fa1-8c2e-f45525f0eed6) It appears to be only happening on page breaks. And only in Google Chrome. I have tried removing / adding alot of stuff but can't quite seem to track it down. It's happening sometimes but also it's hard to track down. It's kinda more of just an anxiety bug because I don't know if my sentences are gone are not and I easily miss them on a close read. Plus you have to generate it first and then perhaps even print it to get a good look. Any work-arounds? Any fixes? Thoughts welcome! Nonetheless enjoying octomode / may 1rst energy 🖤 I'm working from https://octomode.vvvvvvaria.org/anarcho-krant-mvp-issue-1/pad/ Thanks!
Poster
Collaborator
https://github.com/pagedjs/pagedjs/issues/130 seems related.
Poster
Collaborator

And perhaps another https://github.com/pagedjs/pagedjs/issues/87

Getting weirder! 😆

And perhaps another https://github.com/pagedjs/pagedjs/issues/87 Getting weirder! 😆
Poster
Collaborator
Dare we update paged.js? https://github.com/pagedjs/pagedjs/issues/87#issuecomment-1476958035 https://unpkg.com/browse/pagedjs@0.5.0-beta.0/dist/ 😱
Owner

Oh..... yes. This is a haunting bug that also appeared when I was making the Volumetric Regimes book.

Here some traces from the conversations around this with the Paged.js developers, full of moments of panick and relieve lol:

About the missing sentence in the 342 pages book (Volumetric Regimes):

  • i checked the zoom, the browser is at 100%
  • all my sizes are in px, including the baseline and top and bottom margins of the page, to avoid the rounding issue
  • when i turn Hyphenology off, the issue disappears

I feel quite desperate now... don't know what to do anymore, the "hack" of this afternoon (working with the CTRL+S saved copy) messes up the text flow, ... which leaves me out of options to try other things or find other hack-ish ways to send this file to print 🙁

It turns out that without Hyphenology everything is oke, but we need Hyphenology for the hyphenation of the book... Did you encounter this missing sentences bug before by any chance, in combination with Hyphenology? Is there anything i can do?

Meanwhile.... i am back at my 342 book project, we are sending it to print, but unfortunately the missing sentences bug reappeared......

Hey Julien, hope you are well! I wanted to let you know that the missing sentences problem strangely enough suddenly disappeared again. The PDF renders oke now, and i'm crossing fingers for it to stay like this!

And I heard that also OSP and others have bumped into it.

Curious to hear what the current status is of this bug, to understand if updating Paged.js would help. Let me ask on the Paged.js Mattermost!

Oh..... yes. This is a haunting bug that also appeared when I was making the Volumetric Regimes book. Here some traces from the conversations around this with the Paged.js developers, full of moments of panick and relieve lol: > About the missing sentence in the 342 pages book (Volumetric Regimes): > - i checked the zoom, the browser is at 100% > - all my sizes are in px, including the baseline and top and bottom margins of the page, to avoid the rounding issue > - when i turn Hyphenology off, the issue disappears > I feel quite desperate now... don't know what to do anymore, the "hack" of this afternoon (working with the CTRL+S saved copy) messes up the text flow, ... which leaves me out of options to try other things or find other hack-ish ways to send this file to print :slightly_frowning_face: > It turns out that without Hyphenology everything is oke, but we need Hyphenology for the hyphenation of the book... Did you encounter this missing sentences bug before by any chance, in combination with Hyphenology? Is there anything i can do? > Meanwhile.... i am back at my 342 book project, we are sending it to print, but unfortunately the missing sentences bug reappeared...... > Hey Julien, hope you are well! I wanted to let you know that the missing sentences problem strangely enough suddenly disappeared again. The PDF renders oke now, and i'm crossing fingers for it to stay like this! And I heard that also OSP and others have bumped into it. Curious to hear what the current status is of this bug, to understand if updating Paged.js would help. Let me ask on the Paged.js Mattermost!
Owner

Done.

m---b 1:37 PM

Hello all! I'm writing with a question around the mystery of sentences disappearing on page breaks... It appeared again, while making a 1st of May anarchist newspaper in Varia. I'm not working on it myself, but it made me curious to check in here and ask what the current status is around these haunting moments?

https://mattermost.coko.foundation/

Done. > m---b 1:37 PM > > Hello all! I'm writing with a question around the mystery of sentences disappearing on page breaks... It appeared again, while making a 1st of May anarchist newspaper in Varia. I'm not working on it myself, but it made me curious to check in here and ask what the current status is around these haunting moments? https://mattermost.coko.foundation/
Owner

julien 3:14 PM

hey there.

i think we had some interesting experiments with @harshna, it seems that when you have some element with a subpixel height, the rounding/conversion seems to break things. Do you have anything set using em?

to explain quickly: on screen, chrome will consider that 8.8px is equal to 8px (6pt)

but when it puts the same content on the paper, it consider that 8.8px = 6.6pt

The amount of content it can add on screen is a bit different than what you have on paper. But since paged,js already made the break between pages. the content moves a little bit.

I have an idea to test later with @harshna so we could come with a more usable solution (i hope)

> julien 3:14 PM > > hey there. > > i think we had some interesting experiments with @harshna, it seems that when you have some element with a subpixel height, the rounding/conversion seems to break things. Do you have anything set using em? > > to explain quickly: on screen, chrome will consider that 8.8px is equal to 8px (6pt) > > but when it puts the same content on the paper, it consider that 8.8px = 6.6pt > > The amount of content it can add on screen is a bit different than what you have on paper. But since paged,js already made the break between pages. the content moves a little bit. > > I have an idea to test later with @harshna so we could come with a more usable solution (i hope)
Owner

And the recommendation is to work with pixels:

because the screen is used to draw the pages first.

(we’re exploring options to change a bit how pagedjs do the conversion but it’s not really that simple)

And the recommendation is to work with pixels: > because the screen is used to draw the pages first. > (we’re exploring options to change a bit how pagedjs do the conversion but it’s not really that simple)
Poster
Collaborator

Thank you @mb! It might be time for me to join the Mattermost as well 😃

Thank you @mb! It might be time for me to join the Mattermost as well 😃
Poster
Collaborator

Sooo, I tried a bunch of work-arounds but nothing much worked for me, sadly.

I will look into other workflows for now and i hope to see a fix come in at some point.

There are some other reports here too:

This bug is aging well 😄

image

Sooo, I tried a bunch of work-arounds but nothing much worked for me, sadly. I will look into other workflows for now and i hope to see a fix come in at some point. There are some other reports here too: - https://gitlab.coko.foundation/pagedjs/pagedjs/-/issues/381 - https://gitlab.coko.foundation/pagedjs/pagedjs/-/issues/357 This bug is aging well 😄 ![image](/attachments/eb032bbd-e0e6-4043-b00a-1bb35e87f09c)
Poster
Collaborator

There was a recommendation to use this diff and then add the following to the stylesheet:

diff --git a/templates/pagedjs.html b/templates/pagedjs.html
index 4375168..412029f 100644
--- a/templates/pagedjs.html
+++ b/templates/pagedjs.html
@@ -10,5 +10,18 @@
 </head>
 <body>
     {{ pad_content }}
+<script>
+  // https://git.vvvvvvaria.org/varia/octomode/issues/25 hack
+  class fixMissingLine extends Paged.Handler {
+    constructor(chunker, polisher, caller) {
+      super(chunker, polisher, caller);
+      this.moveToParentFig = [];
+    }
+    afterRendered(pages) {
+      document.querySelectorAll('.pagedjs_sheet').forEach(sheet => sheet.style.setProperty('--pagedjs-footnotes-height', '0px'))
+    }
+  }
+  Paged.registerHandlers(fixMissingLine);
+</script>
 </body>
 </html>
.pagedjs_sheet {
--pagedjs-footnotes-height: 12px
}

However, I ran this locally and it didn't work. I'm not sure where to load the fixMissingLine since we have the iframe machinery in octomode... does anyone have any ideas? Most likely I didn't get it loaded correctly?

I also took a look at swapping in a newer version of https://unpkg.com/browse/pagedjs@0.5.0-beta.0/dist/ but I wasn't sure which I should us? My attempts just resulted in the page having 0 pagedjs styles on pdf generation 🤔

There was a recommendation to use this diff and then add the following to the stylesheet: ```diff diff --git a/templates/pagedjs.html b/templates/pagedjs.html index 4375168..412029f 100644 --- a/templates/pagedjs.html +++ b/templates/pagedjs.html @@ -10,5 +10,18 @@ </head> <body> {{ pad_content }} +<script> + // https://git.vvvvvvaria.org/varia/octomode/issues/25 hack + class fixMissingLine extends Paged.Handler { + constructor(chunker, polisher, caller) { + super(chunker, polisher, caller); + this.moveToParentFig = []; + } + afterRendered(pages) { + document.querySelectorAll('.pagedjs_sheet').forEach(sheet => sheet.style.setProperty('--pagedjs-footnotes-height', '0px')) + } + } + Paged.registerHandlers(fixMissingLine); +</script> </body> </html> ``` ```css .pagedjs_sheet { --pagedjs-footnotes-height: 12px } ``` However, I ran this locally and it didn't work. I'm not sure where to load the `fixMissingLine` since we have the `iframe` machinery in octomode... does anyone have any ideas? Most likely I didn't get it loaded correctly? I also took a look at swapping in a newer version of https://unpkg.com/browse/pagedjs@0.5.0-beta.0/dist/ but I wasn't sure which I should us? My attempts just resulted in the page having 0 pagedjs styles on pdf generation 🤔
Poster
Collaborator

Solution: use <br> and fuck it.

Solution: use `<br>` and fuck it.
Poster
Collaborator

It was the font! Can't remember now all the details but specific fonts cause the text to dissapear. Once we switched to another font, it was resolved. So, watch out with fonts 😆

It was the font! Can't remember now all the details but specific fonts cause the text to dissapear. Once we switched to another font, it was resolved. So, watch out with fonts 😆
decentral1se closed this issue 5 months ago
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.