Skip to content

fix: allow to use text and text_box in sequence with inline format flag#1268

Open
majioa wants to merge 1 commit into
prawnpdf:masterfrom
majioa:master
Open

fix: allow to use text and text_box in sequence with inline format flag#1268
majioa wants to merge 1 commit into
prawnpdf:masterfrom
majioa:master

Conversation

@majioa

@majioa majioa commented Jun 8, 2022

Copy link
Copy Markdown
  • ! allow to use text and text_box in sequence with inline format flag

!  allow to use text and text_box in sequence with inline format flag
@gettalong

Copy link
Copy Markdown
Member

I'm sorry but I don't understand the reason of the change. Could you be a bit more expressive with respect to explaining the reason for the PR?

@majioa

majioa commented Jun 9, 2022

Copy link
Copy Markdown
Author

Fox example I have a chain to draw text (as in the docs) but using the inline formatting. Since the excess_text after the call will contain an array of formatted text, so to keep the call stylistics to code with no inline formatting, and avoiding the exception, I just added the following two lines.

     excess_text = pdf.text_box(
        rendered(desc),
        width: 242,
        height: 242,
        overflow: :truncate,                                                   
        at: [0, y_position],                                                   
        inline_format: true                                                    
     )
                                                    
     pdf.text(excess_text, width: 450, inline_format: true)   

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants