-
Notifications
You must be signed in to change notification settings - Fork 0
/
pdf-image-result.cpp
53 lines (43 loc) · 1.14 KB
/
pdf-image-result.cpp
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
48
49
50
51
52
53
/*
* pdf-poppler.cpp
*
* Created on: Oct 31, 2017
* Author: gnat
*/
#include <phpcpp.h>
#include <iostream>
#include <string.h>
#include "pdf-image-result.h"
PdfImageResult::PdfImageResult(int inImageWidth, int inImageHeight,
int inPageWidth, int inPageHeight, std::string inPage) {
imageWidth = inImageWidth;
imageHeight = inImageHeight;
pageWidth = inPageWidth;
pageHeight = inPageHeight;
page = inPage;
}
void PdfImageResult::__construct() {
}
Php::Value PdfImageResult::getImageWidth() {
return imageWidth;
}
Php::Value PdfImageResult::getImageHeight() {
return imageHeight;
}
Php::Value PdfImageResult::getPageWidth() {
return pageWidth;
}
Php::Value PdfImageResult::getPageHeight() {
return pageHeight;
}
Php::Value PdfImageResult::getPage() {
return page;
}
Php::Value PdfImageResult::getRelativePage(Php::Parameters ¶ms) {
std::string rootPath = params[0].stringValue();
size_t pagePos = page.find(rootPath);
if (pagePos == std::string::npos) {
throw Php::Exception(rootPath + " not found within page: " + page);
}
return page.substr(+rootPath.length());
}