Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
FREEDOM251

Freedom251 › Blog › Developer Tools

How to Capture Visual Studio Code Markdown Previews as Full-Page Images or PDFs

By Freedom251 Team · · 12 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a PDF, open the rendered Markdown preview in Visual Studio Code and use your system print dialog to choose Save as PDF. For a single, full-document PNG or JPEG—or a PDF with repeatable page dimensions—install the Markdown PDF extension and run its export command. The built-in route needs no extension and is closest to the preview you see; Markdown PDF adds Chromium-based rendering, image export, clipping, and layout controls.

Choose the capture method first

Your output and repeatability requirements determine the best workflow. VS Code renders Markdown out of the box, so a PDF does not require an extension. A one-piece image of a long document is different: normal screen capture only records the visible viewport, while a full-document exporter must render the page and stitch or clip the complete surface.

As an Amazon Associate I earn from qualifying purchases.

Goal Recommended path Why
A quick PDF that looks like the VS Code preview Built-in preview plus the host print command No installation; uses the preview already rendered by VS Code.
One long PNG or JPEG Markdown PDF extension, Export (png) or Export (jpeg) It captures the full document and exposes screenshot clipping and dimensions.
A controlled, repeatable PDF Markdown PDF extension, Export (pdf) Paper size, orientation, margins, page ranges, width, height, and print backgrounds can be set explicitly.
Math, Mermaid, or PlantUML is part of the document Markdown Preview Enhanced, or the renderer that your project already uses Its rich syntax support can be the source of truth; export its PDF, then use a separate screenshot tool if you need a raster image.
A print-oriented PDF panel Print2Paper4VSCode It provides a one-keystroke print/save workflow for Markdown’s HTML preview on macOS, Windows, and Linux.

Do not use a very tall raster image for a document intended to be read on paper. A PDF keeps text selectable and paginates naturally; PNG is lossless and useful when an exact visual snapshot must be embedded elsewhere, while JPEG is smaller but can show compression around text and diagrams.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prepare the Markdown preview

  1. Save the file with a .md extension. The preview is generated from the saved document, so save again after edits before exporting.
  2. Open the Command Palette and run Markdown: Open Preview. The shortcut is Ctrl+Shift+V on Windows and Linux, and Shift+Cmd+V on macOS.
  3. For a side-by-side editor and preview, run Markdown: Open Preview to the Side. Its shortcuts are Ctrl+K V on Windows/Linux and Cmd+K V on macOS.
  4. Make the preview the active surface before printing or exporting. This prevents the editor pane, rather than the rendered HTML, from becoming the capture target.
  5. Wait for remote images, fonts, Mermaid diagrams, and other dynamic content to finish. A heading can appear before a diagram or image has completed, so exporting immediately can produce a partial document.

Use local assets and fixed CSS when you need reproducible captures. Remote resources introduce network timing, changing content, and font substitution that can alter page breaks between runs.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Save the preview as a PDF without an extension

The built-in route is the lowest-friction option and usually preserves the appearance of the rendered preview better than converting the raw Markdown file. It relies on the print controls supplied by your operating system or browser surface, so labels differ slightly by platform.

Windows and Linux

  1. Open the Markdown preview using one of the commands above.
  2. With the preview active, invoke the host print command. In most environments this is Ctrl+P; use the print command exposed by your desktop if that shortcut is intercepted.
  3. Choose Save as PDF or Microsoft Print to PDF as the destination.
  4. Set paper size, orientation, margins, scale, page range, and background graphics. Check the print preview before saving.
  5. Choose a filename and save. Open the resulting PDF and inspect its last page, not just the first page shown in the dialog.

macOS

  1. Open the rendered preview and make it the active surface.
  2. Run the macOS print command, normally Cmd+P.
  3. Use the PDF menu in the print sheet and select Save as PDF.
  4. Review paper size, orientation, margins, scale, page range, and whether background graphics are included. Save only after checking the preview.

Print settings that prevent surprises

  • Paper and orientation: Letter or A4 in portrait is a safe default for prose. Use landscape for wide tables or code, but expect more horizontal whitespace on ordinary paragraphs.
  • Margins: Start with the default margins, then reduce them only if a wide table is being clipped. Extremely small margins can make headers and footers collide with content.
  • Scale: If the final heading or table row is clipped, reduce scale slightly rather than repeatedly changing the Markdown.
  • Background graphics: Enable this option when the preview relies on dark panels, colored callouts, or shaded code blocks. If the result is intended for economical printing, a light print stylesheet is usually more readable.
  • Page ranges: Use a range for a selected chapter, but first export the complete document once to verify that page breaks are sensible.
  • Print preview: Check headings, tables, fenced code, links, diagrams, and the final line. A document can look correct at the top while the final diagram is still loading or clipped at the bottom.

The exact print controls depend on the host platform and the preview surface. If a setting shown in an online tutorial is missing, use the equivalent control in your system’s print sheet rather than changing the Markdown to compensate.

Export a full-page PNG, JPEG, or controlled PDF with Markdown PDF

The Markdown PDF extension uses a Chromium-based browser and documents commands for markdown-pdf: Export (pdf), Export (png), Export (jpeg), and Export (all: pdf, html, png, jpeg). It is the direct choice when you need one complete long image or the same PDF layout each time.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install and run an export

  1. Open Extensions in VS Code, search for Markdown PDF, and install the extension published under that name.
  2. Open the Markdown file and save it. Keep the preview content stable while the export runs.
  3. Open the Command Palette and choose the desired markdown-pdf: Export command. The export is written alongside the source document unless you have configured another destination.
  4. For a raster capture, choose PNG when text must remain lossless. Choose JPEG when file size matters more than fine edge quality.
  5. For a multipage document, prefer PDF. A single extremely tall PNG can be difficult to open, print, or annotate even when the pixels are correct.

Set page geometry for PDF

Configure the extension’s paper format (including A4, Letter, and other formats), orientation, page ranges, explicit width and height, margins, and print-background behavior. Set these values before exporting rather than resizing the finished file, because changing dimensions afterward can move headings and split tables.

  • Choose a paper format that matches the people who will print the document.
  • Use landscape only for content that genuinely needs the extra width.
  • Set explicit width and height when the output must match a design canvas or a downstream slide.
  • Keep print backgrounds enabled for intentional color blocks; otherwise use a light stylesheet.
  • Use page ranges for selected sections after you have verified the complete-document pagination.

Make one long image instead of a viewport screenshot

PNG and JPEG exports use screenshot clipping settings such as clip.x, clip.y, clip.width, and clip.height. First export or inspect the page to learn its rendered dimensions, then set the clip rectangle to cover the entire document. If the height is too small, the bottom is cut off; if it is larger than the rendered surface, you may get unwanted blank space.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

For a predictable image, set an explicit width, allow the document to determine its full height, and verify the last heading, table row, and diagram. Retina or high device scale produces sharper text at the cost of a larger file; downsample only after you have confirmed that the source capture is complete.

Apply the same settings to repeated exports

Keep the extension settings in your workspace configuration when a team exports the same documentation regularly. Record the paper format, orientation, margins, dimensions, clipping rectangle, and background choice alongside the project so another contributor can reproduce the file. Re-export after changing fonts, preview CSS, or a diagram because any of those can change the measured height.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When the Markdown uses rich syntax

Markdown Preview Enhanced

Markdown Preview Enhanced adds math, Mermaid, PlantUML, presentation support, and PDF export. Choose it when those features are the intended rendering source, not merely because it has more buttons. The available evidence establishes PDF export but not a dedicated full-document PNG command, so use its PDF export for a document or pair the rendered preview with a separate screenshot tool when a raster image is required.

Print2Paper4VSCode

Print2Paper4VSCode advertises one-keystroke printing and saving to PDF, including a rendered mode for Markdown’s HTML preview. It supports macOS, Windows, and Linux and suits a print-first workflow. It is not the right choice solely to obtain a long PNG.

Keep one renderer as the source of truth

Do not edit CSS to make one extension resemble another and then switch renderers at export time. Markdown extensions can interpret diagrams, math, and embedded HTML differently. Decide whether the VS Code built-in preview, Markdown Preview Enhanced, or another project renderer is authoritative, then capture that surface consistently.

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord | 6.35mm Jack, Durable Design, Stage and Home Studio Use, Low Noise Shielded Electric Cord for Bass, Keyboard, Amp, Mixer
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Preview security, images, and styles

VS Code’s default Strict preview security disables scripts and blocks HTTP images. This is a safety boundary, not an export bug. If a trusted workspace genuinely requires scripts or insecure image URLs, change the preview security setting only after reviewing the content; otherwise migrate assets to HTTPS or local files.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When an image is missing, inspect its URL and protocol first. An HTTP image in an otherwise HTTPS or strict preview is commonly blocked. For repeatable documents, package images with the project or serve them from a stable HTTPS location.

VS Code supports preview CSS through the markdown.previewStyles extension contribution point. A project or extension can therefore add print-oriented styles, adjust code wrapping, or change colors before capture. Confirm that the stylesheet applies to the preview you are exporting; changing editor CSS does not necessarily change preview CSS.

Fonts and dynamic diagrams

Wait for web fonts and diagrams to finish before invoking print or export. If a font arrives after layout, line wraps and page breaks can move. Local fonts and deterministic diagram inputs reduce this variability. For a release document, keep a copy of the exported PDF or image with the source revision that produced it.

Troubleshooting incomplete or poor captures

The PDF contains the editor instead of the preview

Cause: The editor was active when the print command was invoked. Fix: click inside the rendered preview, wait for it to finish, and invoke print again. Use the preview-to-side command if you need the editor visible while editing, but activate the preview before capture.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Images or diagrams are missing

Cause: The resource is still loading, uses an HTTP URL blocked by Strict preview security, or depends on a script that the preview has disabled. Fix: wait for loading indicators to settle, use HTTPS or local assets, and review the security setting only for a workspace you trust.

The bottom of a long document is cut off

Cause: A print scale, explicit height, or screenshot clip is smaller than the rendered surface. Fix: reduce print scale, increase the page width where appropriate, or measure the Markdown PDF page and enlarge clip.height. Confirm the final heading and final table row in the output, not only in the preview.

A table is clipped on the right

Cause: The table is wider than the selected paper and margins. Fix: reduce margins or scale, switch to landscape, or set a wider explicit page. Avoid shrinking the entire document so far that body text becomes unreadable.

Dark colors disappear on paper

Cause: Print background graphics are disabled, or the dark theme is unsuitable for a printer. Fix: enable background graphics for a faithful visual copy, or apply a light print stylesheet for a readable paper version.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The exported PNG is blurry

Cause: The source was captured at a low device scale or compressed as JPEG. Fix: export PNG, use a higher device or retina scale when available, and resize down only after the capture. JPEG is appropriate when a smaller file is more important than crisp text.

Page breaks change between exports

Cause: Fonts, remote images, dynamic diagrams, or CSS changed the rendered dimensions. Fix: use fixed CSS and local assets, wait for all resources, and keep the extension’s paper, margin, and dimension settings under version control.

The print command is unavailable

Cause: focus is in a surface that intercepts the shortcut, or the desktop uses a different command. Fix: run the operating system’s print command from its menu or command search with the preview active. The built-in workflow depends on the host print implementation.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance and repeatability guidelines

  • Stabilize the input: save the Markdown, use fixed-width assets where possible, and avoid content that changes while the capture is running.
  • Render once, export once: let images, fonts, and diagrams settle before calling print or the extension. Repeated premature exports create different page breaks and make debugging harder.
  • Choose the smallest sufficient output: PDF for multipage reading, PNG for lossless visual embedding, JPEG for a smaller photographic or preview asset.
  • Check both extremes: inspect the first page for margins and the final page or final pixels for clipping. Also inspect the widest table and the largest code block.
  • Record settings: document the renderer, paper format, orientation, margins, dimensions, clipping rectangle, background policy, and any preview CSS used.
  • Separate trusted content from untrusted content: do not relax preview security merely to make an export work when a safe HTTPS or local asset can solve the problem.

Or skip the browser setup

If the rendered Markdown is available at a URL that the service can reach, ScreenshotNeo can produce a screenshot or PDF with one request. It is not a replacement for the local VS Code pane: an unsaved file or a private file:// preview must first be published or exposed at a reachable URL. Once the page is hosted, the API can handle full-page capture and the timing controls that are otherwise easy to get wrong in a browser.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read the parameter reference in the ScreenshotNeo documentation. The same endpoint supports PNG, JPEG, WebP, or PDF output. Relevant controls for a hosted Markdown page include full-page capture with lazy images loaded, a CSS-selector element capture, dark mode, twelve device presets or any viewport, retina scale, PDF paper size, margins, landscape and page ranges, custom CSS and JavaScript, clicks before capture, hidden selectors, waits for a selector, delay or network idle, blocking ads, trackers, requests or resource types, custom headers, cookies, user agents and Authorization, timezone and geolocation, transparent backgrounds, image resizing, a cache with a chosen TTL, signed links for public <img> tags, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API, an OpenAPI specification, and compatibility with parameter names used by other screenshot APIs.

cURL

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Replace the example URL with the public URL of your rendered Markdown page. The response format can be selected with the API’s output parameters; the example writes a WebP file.

Python

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo accepts the cookie or consent banner like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before the capture; each cleanup step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.

The Free plan includes 1,000 shots per month with no card. Paid plans start at $5 for 3,000 shots; Growth is $15 for 15,000, Pro is $39 for 60,000, Scale is $99 for 250,000, and Business is $249 for 1,000,000. Yearly billing gives two months free, and every feature is available on every plan. Sign up for the free plan to try a hosted-preview capture with no card.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Decision checklist

  • Choose built-in print when you need one PDF quickly and the VS Code preview itself is the authority.
  • Choose Markdown PDF when you need a full-page PNG or JPEG, explicit dimensions, clipping, or repeatable PDF settings.
  • Choose Markdown Preview Enhanced when math, Mermaid, or PlantUML rendering is central and its preview is the intended source.
  • Choose Print2Paper4VSCode when a dedicated print panel is more convenient than the host print dialog.
  • Use ScreenshotNeo when the rendered document is hosted at a reachable URL and you want an API, cleanup of consent clutter, explicit wait and viewport controls, or MCP access for an AI workflow.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Developer ToolsDocumentationJPEGMarkdownPDFPNGVisual Studio Code

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.