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

inserting on 2nd page seems to corrupt data #35

Open
vincer2040 opened this issue Feb 19, 2024 · 0 comments
Open

inserting on 2nd page seems to corrupt data #35

vincer2040 opened this issue Feb 19, 2024 · 0 comments

Comments

@vincer2040
Copy link

This library has been very nice, inserting data on the first page works great, but I have had some issues when inserting data on the second page of the pdf.

I was originally trying to insert images onto the second page, but after executing the program, no images are outputted. I tried to insert them onto the first page, and that worked as expected.

This made me curious, so I tried to insert some text onto the second page and something weird happened

when I do something like

    size, err := pt.MeasureTextWidth("hello")
    if err != nil {
        return err
    }
    err = pt.Insert("hello", 2, 0, 0, size, 100, gopdf.Center|gopdf.Bottom)
    if err != nil {
        return err
    }

The text is inserted in the correct place, but the text that is inserted is "K H O O R" and not "hello".

Note: the second page exists when loading the pdf, but is completely blank before any insertions, could this be the problem?

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

1 participant