You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Bernhard Näckdal <be...@arbetsformedlingen.se.INVALID> on 2022/02/21 10:29:03 UTC

Add "alt text" to image

Dear users,

Can anyone give a hint on how to add a "alt text" to an image in a pdf-document created by PDFBox.

I would like the text to appear when hovering over the image.

I have already added the image to the document and all is looking good. Just missing the "alt text"



I'm using the code

PDImageXObject pdImage = PDImageXObject.createFromByteArray(doc, imageBytes, "af_logo.png");



To add the image.





Thanks for your help



//Bernhard





Re: Add "alt text" to image

Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Am 23.02.22 um 00:28 schrieb Peter Wyatt:
> ISO 32000-1:2008 a.k.a. PDF 1.7, clause 14.9 Accessibility Support covers 14.9.3 Alternate Descriptions, 14.9.4 Replacement Text, and 14.9.5 Expansion of Abbreviations and Acronyms.
> It has to do with Tagged PDF.
OK, so it is not an image feature, it is something optional Thanks for the 
explanation, Peter.

To answer the origin question, PDFBox doesn't support the creation of Tagged 
PDFs. This doesn't prevent anybody from creating the needed structures on their 
own. But this is a lot of work and includes studying the PDF spec and some 
sample PDFs

Andreas

> 
>> -----Original Message-----
>> From: Andreas Lehmkuehler <an...@lehmi.de>
>> Sent: Tuesday, 22 February 2022 4:32 PM
>> To: users@pdfbox.apache.org
>> Subject: Re: Add "alt text" to image
>>
>> Am 21.02.22 um 11:29 schrieb Bernhard Näckdal:
>>> Dear users,
>>>
>>> Can anyone give a hint on how to add a "alt text" to an image in a
>> pdf-document created by PDFBox.
>>>
>>> I would like the text to appear when hovering over the image.
>>>
>>> I have already added the image to the document and all is looking
>> good. Just missing the "alt text"
>> Never heard about something like an alt text. Where did you get that
>> from? Do you have an example?
>>
>>
>> Andreas
>>
>>> I'm using the code
>>>
>>> PDImageXObject pdImage = PDImageXObject.createFromByteArray(doc,
>> imageBytes, "af_logo.png");
>>>
>>>
>>>
>>> To add the image.
>>>
>>>
>>>
>>>
>>>
>>> Thanks for your help
>>>
>>>
>>>
>>> //Bernhard
>>>
>>>
>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


RE: Add "alt text" to image

Posted by Peter Wyatt <pe...@gmail.com>.
ISO 32000-1:2008 a.k.a. PDF 1.7, clause 14.9 Accessibility Support covers 14.9.3 Alternate Descriptions, 14.9.4 Replacement Text, and 14.9.5 Expansion of Abbreviations and Acronyms. 
It has to do with Tagged PDF.

> -----Original Message-----
> From: Andreas Lehmkuehler <an...@lehmi.de>
> Sent: Tuesday, 22 February 2022 4:32 PM
> To: users@pdfbox.apache.org
> Subject: Re: Add "alt text" to image
> 
> Am 21.02.22 um 11:29 schrieb Bernhard Näckdal:
> > Dear users,
> >
> > Can anyone give a hint on how to add a "alt text" to an image in a
> pdf-document created by PDFBox.
> >
> > I would like the text to appear when hovering over the image.
> >
> > I have already added the image to the document and all is looking
> good. Just missing the "alt text"
> Never heard about something like an alt text. Where did you get that
> from? Do you have an example?
> 
> 
> Andreas
> 
> > I'm using the code
> >
> > PDImageXObject pdImage = PDImageXObject.createFromByteArray(doc,
> imageBytes, "af_logo.png");
> >
> >
> >
> > To add the image.
> >
> >
> >
> >
> >
> > Thanks for your help
> >
> >
> >
> > //Bernhard
> >
> >
> >
> >
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: Add "alt text" to image

Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Am 21.02.22 um 11:29 schrieb Bernhard Näckdal:
> Dear users,
> 
> Can anyone give a hint on how to add a "alt text" to an image in a pdf-document created by PDFBox.
> 
> I would like the text to appear when hovering over the image.
> 
> I have already added the image to the document and all is looking good. Just missing the "alt text"
Never heard about something like an alt text. Where did you get that from? Do 
you have an example?


Andreas

> I'm using the code
> 
> PDImageXObject pdImage = PDImageXObject.createFromByteArray(doc, imageBytes, "af_logo.png");
> 
> 
> 
> To add the image.
> 
> 
> 
> 
> 
> Thanks for your help
> 
> 
> 
> //Bernhard
> 
> 
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org