PDFLine has an unwanted rectangle

I am trying to add a PDFLine under my heading on a PDF. I have been using the Xojo Example ‘Lines’ for help, but both the Xojo example and my code place a weird and unwanted rectangle on the lefthand side of my line.

How can I get rid of this rectangle?!

Xojo example ‘Lines’:

My Xojo Chart exported as PDF:

I have added a Feedback case:

https://tracker.xojo.com/xojoinc/xojo/-/issues/77038

1 Like

Thanks to @Martin_T in Feedback, it’s an Apple Preview bug.

I opened the PDF in FireFox and PDF Pen Pro and the rectangle doesn’t display. When I opened the PDF in Safari the whole line is missing!

1 Like

Hi @David_Cox

Just curious about why are you using PDFLine instead of the regular Graphics.DrawLine. I’m asking because PDFLine is part of the PDF Annotation set of features where you can, well, attach a text to the PDF object… while if it is only for ornamentally purposes, then DrawLine is good enough.

I was following the Xojo example, that’s all. I want a PDFDocument to look the same as one generated by wkHTML2PDF, but with a vector chart rather than PNG. I don’t care how the line is generated.

For that… Graphics.DrawLine. If you need to add Annotations to a PDF, then PDFLine is one option you can use among the existing ones.

1 Like