Thursday, 22 August 2019

How to export a graph with alternative text in Excel to PDF using Python or R?

I have about 500 graphs generated in Excel using VBA and I need to export them to pdf. These graphs have alternative text to make them accessible for blind people. When I use the VBA (ExportAsFixedFormat) to generate the pdf, the alternative text will be missed in the pdf. Is there a code in python or R to convert the graph from excel to pdf and retain the alternative text?

If I manually save the graphs as pdf, the alternative text will be saved with the graph in pdf file. However, since I have too many graphs, it would be good to be able to do this automatically.

 ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=PdfFileName, _
        Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False

The above code in VBA is helpful for creating pdf but does not keep the alternative text.



from How to export a graph with alternative text in Excel to PDF using Python or R?

No comments:

Post a Comment