Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text inside canvas #674

Closed
Purush0th opened this issue Aug 18, 2016 · 5 comments
Closed

Text inside canvas #674

Purush0th opened this issue Aug 18, 2016 · 5 comments

Comments

@Purush0th
Copy link

Purush0th commented Aug 18, 2016

I want to print text with in a rectangular box. I am seeing canvas option (type: 'rect') which lets us to draw rectangles.

        {
            canvas: [
                {
                    type: 'rect',
                    x: 1,
                    y: 10,
                    w: 250,
                    h: 100,
                    r: 4,
                    lineColor: '#000',
                }
                               ]
              }

How to write text inside it? Or is the anyway to specify coordinates for text?

@pemaxim
Copy link

pemaxim commented Sep 6, 2016

+1

@Focushift
Copy link

try this custom function from reply №5 #74

@ottigerb
Copy link

+1

Something like this - inside "canvas": [] - would be great!

                   {
                        type: "text",
                        x: 0,
                        y: 0,
                        font: '36pt Arial',
                        fillStyle: '#3F51B5',
                        text: 'My TEXT'
                    }

Any idea for a "workaround"? custom function from reply №5 #74 does not help. Just have to print some Numbers & Text inside a canvas. Basically to create some "charts".

@franbueno
Copy link

+1

@liborm85
Copy link
Collaborator

liborm85 commented Apr 2, 2017

Use absolutePosition, see example: https://github.com/bpampuch/pdfmake/blob/master/examples/absolute.js

@liborm85 liborm85 closed this as completed Apr 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants