Skip to content

Annotation lines too thin/non-existent #1904

Open
@bobweasel

Description

@bobweasel

The annotation lines are very thin. I can only see them if i put a shape fill, but that means I get a filled-in shape as well. If I draw an annotation using Adobe Acrobat, I will be able to see the lines.

Environment

Which environment were you using when you encountered the problem?

$ python -m platform
Windows-10-10.0.19044-SP0

$ python -c "import pypdf;print(pypdf.__version__)"
3.10.0

Code + PDF

This is a minimal, complete example that shows the issue:

from pypdf import PdfReader, PdfWriter
from pypdf.generic import AnnotationBuilder

reader = PdfReader("1.pdf")
writer = PdfWriter()

page = reader.pages[0]
fields = reader.get_fields()

writer.append(reader)

annotation = AnnotationBuilder.rectangle(
    rect=(225, 469, 243, 484), interiour_color='000000'
)
writer.add_annotation(page_number=0, annotation=annotation)
annotation = AnnotationBuilder.rectangle(
    rect=(125, 469, 243, 484),
)
writer.add_annotation(page_number=0, annotation=annotation)

# write "output" to pypdf-output.pdf
with open("filled-out.pdf", "wb") as output_stream:
    writer.write(output_stream)

Share here the PDF file(s) that cause the issue. The smaller they are, the
better. Let us know if we may add them to our tests!
Any PDF file.

Traceback

This is the complete Traceback I see:
No Traceback

Metadata

Metadata

Assignees

No one assigned

    Labels

    EasyThis issue is a good starting point for first-time contributorsnf-documentationNon-functional change: Documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions