Skip to main content
All three classes are instantiated with new and expose a single async method: convert(options) → Promise<Buffer>.

UrlConverter

HtmlConverter

MarkdownConverter

Shared conversion options

See Types for full definitions. Summary:
  • properties — PageProperties (paperSize, size, margins, landscape, singlePage, nativePages, etc. — each independently optional)
  • header, footer — path, Buffer, or ReadStream
  • nativeBookmarks (bookmarks from the headings; implies nativeTaggedPdf), nativeTaggedPdf
  • stages — Stage[], post-processing run on the printed PDF, in order (see Stages)
  • userAgent — override the User-Agent header sent by Chromium
  • emulatedMediaType, emulatedMediaFeatures (an object, such as { "prefers-color-scheme": "dark" })
  • waitDelay, waitForSelector, waitForExpression, waitForWindowStatus
  • extraHttpHeaders, failOnHttpStatusCodes, failOnConsoleExceptions, failOnConsoleMessageTypes, failOnResourceHttpStatusCodes, ignoreResourceHttpStatusDomains, failOnResourceLoadingFailed, skipNetworkIdleEvent, skipNetworkAlmostIdleEvent
  • cookies
  • archives, downloadFrom — see Files and downloads
  • webhook — see Webhooks
  • outputFilename, trace — see Request tracing
PathLikeOrReadStream = string (path) | Buffer | ReadStream.