I Built a PDF/Word/PPT to Markdown WeChat Mini Program with WorkBuddy
I used AI to build a WeChat mini program that converts PDF, Word, and PPT files into Markdown.
It hit a wall halfway through: the table inside the PDF came out gone.
Here's the full process of how I fixed it.
📚 Table of Contents
- 1. What I Actually Wanted to Build
- 2. The First Version Was Running Quickly
- 3. The Table in the PDF Disappeared the First Time
- 4. When Something Broke, I Didn't Go Dig Through the Code
- 5. After the Fix, I Tested the Same PDF Again
- 6. The Biggest Takeaway This Time
1. What I Actually Wanted to Build
Markdown is a very plain text format — no layout, no headers or footers — and AI reads it far more smoothly than PDF.
I often need to convert PDF, Word, and PPT into Markdown, then hand it to ChatGPT or Claude.
Conversion sites online either have ads, or don't support every format, or make you upload the file first.
So I just built one myself, for my own use.
I didn't plan to write the file parsing from scratch — I'd use Microsoft's open-source MarkItDown.
The idea was simple:
MarkItDown handles the conversion, WorkBuddy turns it into a usable mini program.
I stated the requirement once, clearly, and left the rest to it. The gist was these five lines:
Build me a small local file-to-Markdown tool.
Use MarkItDown underneath; the first version should support PDF / DOCX / PPTX.
It needs to upload files, preview the result, one-click copy and download, and show a clear message when conversion fails.
All files must be processed locally — nothing uploaded to a third-party server.
Write it in Python, as a small tool I can open and use directly in a local browser.
(It's fine if you don't understand the words above — the only thing that matters is stating what you want clearly. My complete original requirement is in the appendix at the end if you want to read it.)
Then I let WorkBuddy start working.
2. The First Version Was Running Quickly
The environment, the code, the pages — basically all of it was left to it.
Before long, a most basic version came out.
The whole flow was simple: select file → start conversion → preview Markdown → copy / save.
No extra features, which suited me. What I cared about was whether conversion worked, not how elaborate the interface was.

After the first version came out, I didn't keep asking it to add features — I tested first.
I prepared three files with the same content: PDF, Word (DOCX), PPT (PPTX), containing headings, body text, lists, Chinese and English text, and a simple table.

I tested Word first — headings, lists, and tables were all normal.

Then PPT — the content extracted normally too.
Then I got to PDF, and ran into a fairly interesting problem.
3. The Table in the PDF Disappeared the First Time
There was clearly a table inside the PDF.
But after conversion to Markdown, the table structure was gone.
The content was still there, but it had turned into plain text.
Something like this:
Before conversion:
| Format | Purpose | Result |
|---|---|---|
| Test document | Extract content | |
| DOCX | Test table | Preserve structure |
After conversion it became:
Format Purpose Result PDF Test document Extract content DOCX Test table Preserve structure
In other words:
The text wasn't lost, but the "table" was.

At first I thought the mini program WorkBuddy wrote had a problem.
Then I tried something else.
The same PDF:
Converted to Word first, then Word to Markdown.
And this time the table came out normal.
So the problem wasn't in the front-end page at all.
It was in how the PDF itself gets parsed.
4. When Something Broke, I Didn't Go Dig Through the Code
When I found the problem, what I did was actually very simple.
I told WorkBuddy the symptom directly:

I found a problem with the current tool:
When a PDF contains a table, after conversion with MarkItDown the table often becomes plain text and can't output a standard Markdown table.
But if the same PDF is first converted to DOCX and then converted with MarkItDown, the Markdown table is preserved normally.
Please don't modify the code directly yet.
First check the currently installed MarkItDown version.
The latest stable version should be 0.1.7 — confirm whether the latest stable version is in use, and confirm the PDF-related dependencies (including pdfplumber) are correctly installed.
After upgrading, re-test with the existing PDF table test file.
If the new MarkItDown still can't reliably recognize PDF tables, then adjust the architecture:
DOCX, PPTX: keep using Microsoft MarkItDown;
PDF: switch to Docling;
Enable table structure recognition in Docling;
Output Markdown uniformly in the end;
The front-end interface and user operation flow stay unchanged.
Do not use a "PDF → Word → Markdown" intermediate conversion approach.
When done, compare the Markdown results before and after using the same table-bearing PDF, and tell me exactly what was changed.Then I let it keep investigating.
This is also the part I liked.
I didn't go looking for:
Which file had the problem.
Which function handled PDF.
Where the table parsing logic was.
My process was basically:
Test → find the problem → describe the symptom → have WorkBuddy fix it → test again.
5. After the Fix, I Tested the Same PDF Again
Once the problem was solved, I re-uploaded that same PDF.
This time the table was finally normal.
The content that had scattered before could now be output as a Markdown table again.
In other words:
Before the fix:
Format Purpose Result PDF Test document Extract content
After the fix:
| Format | Purpose | Result |
| --- | --- | --- |
| PDF | Test document | Extract content |
I actually think this screenshot is more interesting than "AI built the whole project successfully in one go."
Because real development basically never gets it perfect the first time.
Especially PDF — the format has plenty of weird problems of its own.
What matters isn't:
Whether AI got everything right the first time.
It's:
Whether it can keep helping you solve the problem once one shows up.
After all that, the mini program looked like this:

6. The Biggest Takeaway This Time
In the past, when I saw an open-source project like MarkItDown, my reaction was to bookmark the GitHub repo, skim the README, and only open a terminal and run commands when I actually needed it.
Now my thinking has changed.
If an open-source project works well but isn't convenient to use:
Then why can't I have AI wrap it in an interface I actually like?
I also never intended to turn it into a "proper product" — no account system, none of the features I'd never use myself.
I just wanted to make a small tool I'd actually use.
What I built this time isn't complicated. But from "an idea" to "a mini program that really works inside WeChat," only a very short stretch of time passed.
A lot of things I used to think "this need is too small to be worth building" can now be answered with: "then just build it for yourself."
As for how this mini program actually gets published online, I wrote that up separately. Because "building it" and "really releasing it for other people to use" are two entirely different things.
Appendix: The Complete Requirement I Originally Sent to WorkBuddy
Build me a small local file-to-Markdown tool.
Use Microsoft's open-source project MarkItDown underneath:
https://github.com/microsoft/markitdown
The first version only needs to support:
PDF, DOCX, PPTX to Markdown.
The main use case is converting documents into Markdown that's easier for AI like ChatGPT and Claude to read and process.
Requirements:
Support click or drag-and-drop file upload
Show file name, file type, and size
Click a button to start conversion
Show a Markdown preview after conversion
Support one-click copy of the Markdown
Support downloading a .md file
Show a clear message when conversion fails
All files processed locally only, nothing uploaded to a third-party server
Temporary files deleted automatically after conversion
Keep the page as simple and clean as possible.
Use Python to call MarkItDown, as a small tool I can use directly in a local browser.
Please check the local Python environment and install the required dependencies first, then finish development and run it so I can test.Next: Once It's Built, How Do You Ship It?
Right now this mini program only lives on your own computer. How to get it onto your phone and how to send it to a friend to scan is in the next article:
👉 WeChat Mini Program Release Testing: From Installing the Tools to Sending a QR Code to a Friend
