I love using Markdown to write technical documents, but in actual work, I
often need to convert Markdown files to PDF. I tried to use a lot of tools, and after practical tests, Visual Studio Code (hereafter referred to as vscode) is the best. The specific steps are as follows:
Article Directory
1. Download and install
1.1 vscode
The first thing to note is that vscode is divided into two versions, System and User. For accomplishing this task, there is not much difference. Here is the download address of a Windows 64-bit User version: https://download.csdn.net/download/herosunly/16201663
After downloading, you can install it step by step according to your needs.
1.2 PDF browser
You can use Adobe Acrobat, such as Adobe Acrobat XI Pro 11. The download address of the cracked patch is: https://download.csdn.net/download/herosunly/14027975
2. Install the plugin: Markdown Preview Enhanced
After entering vscode, press Ctrl+Shift+X three keys at the same time, then enter Markdown Preview Enhanced, select the plug-in shown in the following figure to install, you need to pay attention to the 0.5.17 version, and the author is Yiyi Wang:
3. Use Markdown Preview Enhanced
After installing the plugin, close and reopen vscode. Then click File in the menu bar to open the file to be converted.
Click the right mouse button anywhere in the file before conversion, and the following box will appear, and then click Markdown Preview Enhanced: Open Preview to the Side :
Then in the preview file on the right, click the right mouse button, and then click Open in Browser :
4. Final file conversion
Enter Google browser (Chrome), as shown in the figure below:
Right-click anywhere on the page, and then select print:
Select the target printer as Adobe PDF, as shown in the figure below, then click Print and select the output path corresponding to the PDF file: