-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPDF.h
More file actions
47 lines (42 loc) · 890 Bytes
/
PDF.h
File metadata and controls
47 lines (42 loc) · 890 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#pragma once
#include <iostream>
#include <sstream>
#include <fstream>
#include <format>
#include <memory>
#include <string>
#include <litehtml/document.h>
#include <PDFWriter.h>
#include <PDFUsedFont.h>
#include <PDFPage.h>
#include <PageContentContext.h>
#include <litehtml.h>
#include "Font.h"
class Action;
class PDF
{
public:
PDF();
~PDF();
void start(const std::string& htmlPath);
public:
/// <summary>
/// A4 纸张尺寸,宽度:595 点 ≈ 210 mm,
/// </summary>
int width{ 595 };
/// <summary>
/// A4 纸张尺寸,高度:842 点 ≈ 297 mm
/// </summary>
int height{ 842 };
/// <summary>
/// 纸张边距
/// </summary>
int edge{ 26 };
int viewWidth{ width - edge * 2 };
int viewHeight{ height - edge * 2 };
PDFWriter pdfWriter;
std::vector<Action*> actions;
float dpi{1.f};
private:
private:
};