Skip to content

inserting on 2nd page seems to corrupt data #35

@vincer2040

Description

@vincer2040

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions