PDF Export of long code lines not working properly #555

Closed
opened 2026-02-04 20:59:19 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @fredericmohr on GitHub (Jan 25, 2018).

Originally assigned to: @ssddanbrown on GitHub.

Description

It'd be nice to be able to export technical documents to PDF but the broken export of code boxes with long line (side scrolling) makes that feature pretty much unusable. :(

Bug Report

  • BookStack Version: v0.18 (official demo)
  • PHP Version: Don't know, runs on official demo site
  • MySQL Version: Don't know, runs on official demo site
Expected Behavior

PDF should add line breaks for side-scrolling code boxes (and possible some form of indicator that it is a line break and not a new line)

Current Behavior

PDF just writes long code lines over the edge until it runs out of "paper" to write on...

Steps to Reproduce

export any page to pdf that has a code box with lines long enough that the sideways scroll bar is enabled.

Originally created by @fredericmohr on GitHub (Jan 25, 2018). Originally assigned to: @ssddanbrown on GitHub. ### Description It'd be nice to be able to export technical documents to PDF but the broken export of code boxes with long line (side scrolling) makes that feature pretty much unusable. :( ### Bug Report * BookStack Version: v0.18 (official demo) * PHP Version: Don't know, runs on official demo site * MySQL Version: Don't know, runs on official demo site ##### Expected Behavior PDF should add line breaks for side-scrolling code boxes (and possible some form of indicator that it is a line break and not a new line) ##### Current Behavior PDF just writes long code lines over the edge until it runs out of "paper" to write on... ##### Steps to Reproduce export any page to pdf that has a code box with lines long enough that the sideways scroll bar is enabled.
OVERLORD added the 🐛 Bug🎨 Design labels 2026-02-04 20:59:19 +03:00
Author
Owner

@fredericmohr commented on GitHub (Jan 25, 2018):

example screenshot (see last line of code)
spectacle ab4004

@fredericmohr commented on GitHub (Jan 25, 2018): example screenshot (see last line of code) ![spectacle ab4004](https://user-images.githubusercontent.com/5955966/35391539-4d44bd9a-01df-11e8-8161-bddea5220504.png)
Author
Owner

@ssddanbrown commented on GitHub (Jan 26, 2018):

Thanks for raising, Assigned to next release.

Code note: Fix for this should only be applied to print/export templates otherwise wrapping will cause extra jumpiness on pre tag to codemirror conversion when viewing pages normally.

@ssddanbrown commented on GitHub (Jan 26, 2018): Thanks for raising, Assigned to next release. Code note: Fix for this should only be applied to print/export templates otherwise wrapping will cause extra jumpiness on `pre` tag to codemirror conversion when viewing pages normally.
Author
Owner

@Zaptro commented on GitHub (Jun 23, 2019):

Hello, I hope this is seen by you, since this issue is already closed. I would like to see the same fix for very long inline code also. I use inline codes for ssh commands that can become very long. Viewing them in the web view the code line sometimes extends out of the content area and adds a horizontal scrollbar which is ok so far. But exporting to pdf or html simply cuts off the lines (tested with current version BookStack Beta v0.26.2).

PS: Thanks for the good work on bookstack!

@Zaptro commented on GitHub (Jun 23, 2019): Hello, I hope this is seen by you, since this issue is already closed. I would like to see the same fix for very long inline code also. I use inline codes for ssh commands that can become very long. Viewing them in the web view the code line sometimes extends out of the content area and adds a horizontal scrollbar which is ok so far. But exporting to pdf or html simply cuts off the lines (tested with current version BookStack Beta v0.26.2). PS: Thanks for the good work on bookstack!
Author
Owner

@ssddanbrown commented on GitHub (Jun 23, 2019):

Thanks @Zaptro,
This issue is fairly old and slightly different to your own due to the type of code block. Feel free to open a new issue specific to inline code elements.

@ssddanbrown commented on GitHub (Jun 23, 2019): Thanks @Zaptro, This issue is fairly old and slightly different to your own due to the type of code block. Feel free to open a new issue specific to inline code elements.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#555