Skip to content

Instantly share code, notes, and snippets.

@pdfcrowd
pdfcrowd / html_to_pdf.cpp
Last active March 30, 2023 07:34
Convert a web page or HTML file to PDF in C++. Complete tutorial: https://pdfcrowd.com/blog/convert-html-to-pdf-in-cpp/
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <curl/curl.h>
const char* api_url = "https://api.pdfcrowd.com/convert/latest/";
const char* username = "demo";
const char* api_key = "ce544b6ea52a5621fb9d55f8b542d14d";