aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcms <cms@beatworm.co.uk>2016-10-12 18:04:05 (GMT)
committercms <cms@beatworm.co.uk>2016-10-12 18:04:51 (GMT)
commitd9c17c665a38c1980b0d6b653a5812e845f91bc6 (patch)
treee5966681b969315a1a113faca1676d8715fbdb32
parent0519ea5647cb2a07f3300170e486290f7ef04ba8 (diff)
downloadhydra-d9c17c665a38c1980b0d6b653a5812e845f91bc6.zip
hydra-d9c17c665a38c1980b0d6b653a5812e845f91bc6.tar.gz
hydra-d9c17c665a38c1980b0d6b653a5812e845f91bc6.tar.bz2
Tidyup, regenerate pdf content after edit
reorganise some of the include files more logically call pdf generate after I change the media box for luck
-rw-r--r--src/HydraRootHandler.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/HydraRootHandler.cpp b/src/HydraRootHandler.cpp
index 560ee17..07fe498 100644
--- a/src/HydraRootHandler.cpp
+++ b/src/HydraRootHandler.cpp
@@ -1,15 +1,19 @@
#include "HydraRootHandler.h"
-#include "Poco/Net/HTTPServerRequest.h"
-#include "Poco/Net/HTTPServerResponse.h"
#include "HydraApplication.h"
#include "HydraUnit.h"
+#include "Poco/Net/HTTPServerRequest.h"
+#include "Poco/Net/HTTPServerResponse.h"
+
#include "fpdfview.h"
#include "fpdf_transformpage.h"
+#include "fpdf_edit.h"
+
#include <iostream>
#include <limits.h>
#include <stdio.h>
#include <turbojpeg.h>
+
namespace Hydra {
static bool CheckDimensions(int width, int height) {
@@ -86,7 +90,9 @@ namespace Hydra {
FPDFPage_GetMediaBox(page,&llx,&lly,&urx,&ury);
newurx = urx *scale, newury = ury *scale;
FPDFPage_SetMediaBox(page,llx,lly,newurx, newury);
+ FPDFPage_GenerateContent(page);
FPDF_RenderPageBitmap(bmp,page,0,0,widthPX,heightPX,0,0);
+
FPDFPage_SetMediaBox(page,llx,lly,urx, ury);
response.setContentType("image/jpeg");
response.setChunkedTransferEncoding(true);