Commit 80d95d41 authored by Oleg Korshul's avatar Oleg Korshul

save to pdf (only first page support)

parent 13d57361
......@@ -529,10 +529,11 @@ namespace NSDoctRenderer
if (js_func_get_file_s->IsFunction())
{
v8::Handle<v8::Function> func_get_file_s = v8::Handle<v8::Function>::Cast(js_func_get_file_s);
int nArgument = pParams->m_nSaveToPDFParams;
if (pParams->m_bIsOnlyOnePage)
args[0] = v8::Int32::New(isolate, pParams->m_nSaveToPDFParams);
else
args[0] = v8::Int32::New(isolate, 0x0100);
nArgument |= 0x0100;
args[0] = v8::Int32::New(isolate, nArgument);
v8::Local<v8::Value> js_result2 = func_get_file_s->Call(global_js, 1, args);
if (try_catch.HasCaught())
......
......@@ -288,8 +288,12 @@ namespace PdfReader
oFrame.put_Height(nHeight);
oFrame.put_Stride(-4 * nWidth);
oRenderer.CreateFromBgraFrame(&oFrame);
oRenderer.CreateFromBgraFrame(&oFrame);
oRenderer.SetSwapRGB(false);
dWidth *= 25.4 / dDpiX;
dHeight *= 25.4 / dDpiY;
oRenderer.put_Width(dWidth);
oRenderer.put_Height(dHeight);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment