Fix Missing Alt Text When Converting Markdown to PDF
Question details
Users want to know why image alternative text disappears during Markdown-to-PDF conversion and how to ensure the final output retains tags for Section 508 accessibility compliance.

- Product
- PDF Converter
- Device & OS
- not provided
- Scenario
- Converting a Markdown document containing images with alt text into a standard PDF format.
- Observed behavior
- The alternative text from the original Markdown source code fails to transfer into the PDF's structural tag tree, causing the document to fail accessibility checks.
Verify that your original Markdown file correctly formats image alt text (e.g., ). You will also need a dedicated PDF editor with an accessibility checker to inspect the generated tags.
Use a Tagged PDF Conversion Workflow
Ensure your conversion tool is explicitly configured to support tagged PDFs, which are necessary for preserving metadata like alt text.
Many standard Markdown-to-PDF engines rely on 'Print to PDF' technology, which strips away underlying document structures and flattens images. To retain alternative text for screen readers, you must use an engine that builds a PDF accessibility structure tree.
Use an advanced conversion tool such as Pandoc (with appropriate LaTeX configurations) or an HTML-to-PDF engine that natively supports exporting tagged elements.
During the conversion command or in the software's export settings, check the box or add the parameter for 'Create Tagged PDF' or 'Optimize for Accessibility'.
Open the newly generated PDF in a full-featured PDF editor.
Navigate to the accessibility toolset and run the 'Full Check' to confirm that figure tags and corresponding alt text have been properly carried over to the final document.

Post-Process and Manually Tag the PDF
Use this method if your Markdown converter cannot create tagged PDFs, allowing you to add the missing alt text directly to the resulting document.
Create and Export Accessible PDFs with WPS Office
If your Markdown-to-PDF workflow continually drops alt text, you can maintain full document accessibility by importing your content into WPS Writer. WPS Office securely preserves document structure, images, and alternative text when exporting directly to PDF.
- 1. Transfer your content: Open WPS Writer and paste your Markdown content to convert it into formatted rich text.
- 2. Format image Alt Text: Right-click any image, select 'Picture Properties', and type your descriptive text into the Alternative Text box.
- 3. Export the document: Click on 'Menu' in the top-left corner and select 'Export to PDF'.
- 4. Save as a Tagged PDF: Ensure that the advanced export settings are configured to retain document structure, then click 'Export' to generate your fully accessible PDF.

Frequently Asked Questions
What is a tagged PDF and why does alt text depend on it?
A tagged PDF contains a hidden layer of metadata tags that organize the document into headings, paragraphs, and figures. Screen readers rely entirely on this structural tree to read a document aloud, so alt text cannot be detected unless the image is properly wrapped in a '<Figure>' tag.
Why does 'Print to PDF' destroy alternative text?
The 'Print to PDF' function acts like a virtual printer that flattens your document into a purely visual snapshot. It removes all interactive elements, hyperlinks, and structural metadata like alt text. You must use a dedicated 'Save As' or 'Export' function that generates a tagged file.
Can I automate adding missing alt text to hundreds of PDFs?
While fully automated context-aware alt text generation is challenging, you can use batch processing tools to autotag the physical layout of bulk PDFs. Once the figure tags are created, you will still need to manually input or review the descriptive text for accuracy and Section 508 compliance.
How can I easily test if my PDF has preserved alt text?
You can verify alt text by opening the PDF in an advanced PDF editor and running a built-in Accessibility Checker. Alternatively, you can use screen-reading software like NVDA, VoiceOver, or JAWS to manually tab through the document and listen if the images are described accurately.




