Skip to content

Text.Pdf.mod draws images wrong into PDF Documents #48

@MidimasterSoft

Description

@MidimasterSoft

I do my first steps with text.pdf.mod and was able to add pixmaps into the PDF document. As long as i use a PNG, where X-dimension (WIDTH) is a multiple of 4 (fe. 480x301pix) everything works fine.

but when I use the odd dimension (like (481x301pix) the image in the document gets a horizontal shift like a parallelogram

Image

This is my code:

SuperStrict
Import Text.PDF
Local pdf:TPDFDoc = New TPDFDoc
Local page:TPDFPage = pdf.AddPage()

page.SetWidth(560)   
page.SetHeight(900) 

Local PixMap:TPixmap = LoadPixmap("Zeile1550.png")
Local Image:TPDFImage = pdf.LoadImage(PixMap)
page.SetRGBFill(1.0, 0, 0)
page.DrawImage (Image, 10,770, 550,127)
pdf.Save("NotesExample.pdf")
pdf.Free() 

(I use BlitzMax NG latest release from here)

and this is a example image, which produces the problem

Image

When I expand it to a 1560x300pix PNG the module works as expected

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions