[reportlab-users] Strange rendering of radio buttons

Brijunas, Martynas Martynas.Brijunas at msci.com
Tue Oct 8 07:12:22 EDT 2024


The below dummy code should be enough to demonstrate the problem. Please note I am setting the size to 12 explicitly. Based on my testing, this is the part that causes the trouble. Once the PDF is generated, I am opening it up with Adobe Acrobat.

from reportlab.pdfgen import canvas
from reportlab.pdfbase import pdfform

def create_simple_radios():
    c = canvas.Canvas('simple_radios.pdf')

    c.drawCentredString(300, 700, 'Radio demo')
    form = c.acroForm

    form.radio(name='radio1', value='value1', x=110, y=650, size=12)
    form.radio(name='radio1', value='value2', x=110, y=600, size=12)
    form.radio(name='radio1', value='value3', x=110, y=550, size=12)

    c.save()

if __name__ == '__main__':
    create_simple_radios()




Information Classification: GENERAL

From: Ben Hassell <ben at reportlab.com>
Sent: Tuesday, October 8, 2024 11:44 AM
To: Brijunas, Martynas <Martynas.Brijunas at msci.com>
Cc: reportlab-users <reportlab-users at lists2.reportlab.com>; Andy Robinson <andy at reportlab.com>
Subject: Re: [reportlab-users] Strange rendering of radio buttons

You don't often get email from ben at reportlab.com<mailto:ben at reportlab.com>. Learn why this is important<https://aka.ms/LearnAboutSenderIdentification>
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

Hello Martynas,

You're welcome, that's interesting, in which case could you please share the code you're using to generate the radio buttons?

Kind Regards,
Ben Hassell


On Tue, 8 Oct 2024 at 11:37, Brijunas, Martynas <Martynas.Brijunas at msci.com<mailto:Martynas.Brijunas at msci.com>> wrote:
Hi Ben,

Thank you for your kind suggestion. Based on my test, "forceBorder" does not have any impact on this behaviour. It was previously set to a default value (I assume it defaults to False). I also tried setting it explicitly both to True and False. It results in a mis-rendered radio button.

Thank you.
Martynas



Information Classification: GENERAL
From: Ben Hassell <ben at reportlab.com<mailto:ben at reportlab.com>>
Sent: Tuesday, October 8, 2024 11:28 AM
To: reportlab-users <reportlab-users at lists2.reportlab.com<mailto:reportlab-users at lists2.reportlab.com>>
Cc: Andy Robinson <andy at reportlab.com<mailto:andy at reportlab.com>>; Brijunas, Martynas <Martynas.Brijunas at msci.com<mailto:Martynas.Brijunas at msci.com>>
Subject: Re: [reportlab-users] Strange rendering of radio buttons

You don't often get email from ben at reportlab.com<mailto:ben at reportlab.com>. Learn why this is important<https://aka.ms/LearnAboutSenderIdentification>
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

Hello Martynas,

Could you please see if the forceBorder is set and if so try unsetting it?

Kind Regards,
Ben Hassell


On Mon, 7 Oct 2024 at 14:28, Brijunas, Martynas via reportlab-users <reportlab-users at lists2.reportlab.com<mailto:reportlab-users at lists2.reportlab.com>> wrote:
Hi Andy,

Thank you for responding so quickly. I must admit that this is the first time I am using reportlab, I do not have any prior experience.

For reference, this is how the problem looks like on my side (only if the radio button is smaller than 20 points).

[cid:image001.png at 01DB197A.13520B10]

[cid:image002.png at 01DB197A.13520B10]



Many thanks
Martynas



Information Classification: GENERAL
From: Andy Robinson <andy at reportlab.com<mailto:andy at reportlab.com>>
Sent: Monday, October 7, 2024 1:58 PM
To: reportlab-users <reportlab-users at lists2.reportlab.com<mailto:reportlab-users at lists2.reportlab.com>>
Cc: Brijunas, Martynas <Martynas.Brijunas at msci.com<mailto:Martynas.Brijunas at msci.com>>
Subject: Re: [reportlab-users] Strange rendering of radio buttons

You don't often get email from andy at reportlab.com<mailto:andy at reportlab.com>. Learn why this is important<https://aka.ms/LearnAboutSenderIdentification>
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

Hi Brijunas,

Thanks for reporting this. We have not changed any code relating to form widgets in many years.  Which version were you using previously which worked OK? We can investigate

-Andy

Sent from Gmail Mobile




Information Classification: GENERAL
On Mon, 7 Oct 2024 at 13:38, Brijunas, Martynas via reportlab-users <reportlab-users at lists2.reportlab.com<mailto:reportlab-users at lists2.reportlab.com>> wrote:
Hi,

I have noticed a strange behavior of radio buttons with reportlab 4.2.5. The problem shows only when the size of a radio button is set to less than 20 points. If a resulting PDF document is opened in Adobe Acrobat afterwards, strange rendering artifacts can be seen once the button is hovered over or clicked. I would appreciate any advice in this matter.

Thank you.


________________________________

Information regarding MSCI's processing of personal data may be found at www.msci.com/privacy-pledge<http://www.msci.com/privacy-pledge>. This email message and any attachments are for the sole use of the intended recipients and may contain proprietary and/or confidential information which may be privileged or otherwise protected from disclosure. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not an intended recipient, please contact the sender by reply email and destroy the original message and any copies of the message as well as any attachments to the original message. Local registered entity information: https://www.msci.com/local-registered-entities

Information Classification: GENERAL
_______________________________________________
reportlab-users mailing list
reportlab-users at lists2.reportlab.com<mailto:reportlab-users at lists2.reportlab.com>
https://pairlist2.pair.net/mailman/listinfo/reportlab-users
_______________________________________________
reportlab-users mailing list
reportlab-users at lists2.reportlab.com<mailto:reportlab-users at lists2.reportlab.com>
https://pairlist2.pair.net/mailman/listinfo/reportlab-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist2.pair.net/pipermail/reportlab-users/attachments/20241008/67b12eb4/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 5675 bytes
Desc: image001.png
URL: <https://pairlist2.pair.net/pipermail/reportlab-users/attachments/20241008/67b12eb4/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 3918 bytes
Desc: image002.png
URL: <https://pairlist2.pair.net/pipermail/reportlab-users/attachments/20241008/67b12eb4/attachment-0003.png>


More information about the reportlab-users mailing list