Commit 63b2bb44 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander.Trofimov

pdf print

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@61276 954022d7-b5bf-4e40-9824-e11837661b57
parent ee925b0f
......@@ -2669,6 +2669,32 @@ CDrawingDocument.prototype =
this.AutoShapesTrack.DrawInlineMoveCursor(_near.Page, _near.X, _near.Y, _near.Height, _near.transform);
}
},
RenderDocument : function(Renderer)
{
var _count = this.LogicDocument.Pages.length;
for (var i = 0; i < _count; i++)
{
var _info = this.LogicDocument.Get_PageLimits(i);
Renderer.BeginPage(_info.XLimit, _info.YLimit);
this.LogicDocument.DrawPage(i, Renderer);
Renderer.EndPage();
}
},
ToRenderer : function()
{
var Renderer = new CDocumentRenderer();
Renderer.VectorMemoryForPrint = new CMemory();
var old_marks = this.m_oWordControl.m_oApi.ShowParaMarks;
this.m_oWordControl.m_oApi.ShowParaMarks = false;
this.RenderDocument(Renderer);
this.m_oWordControl.m_oApi.ShowParaMarks = old_marks;
var ret = Renderer.Memory.GetBase64Memory();
//console.log(ret);
return ret;
}
};
......
......@@ -514,6 +514,9 @@ function CDrawingStream(_writer)
this.m_oLastFont2 = null;
this.m_bIntegerGrid = true;
this.m_oPen = new CPen();
this.m_oBrush = new CBrush();
}
CDrawingStream.prototype =
......@@ -550,6 +553,11 @@ CDrawingStream.prototype =
// pen methods
p_color : function(r,g,b,a)
{
var _c = this.m_oPen.Color;
_c.R = r;
_c.G = g;
_c.B = b;
_c.A = a;
this.Native["PD_p_color"](r,g,b,a);
},
p_width : function(w)
......@@ -559,6 +567,11 @@ CDrawingStream.prototype =
// brush methods
b_color1 : function(r,g,b,a)
{
var _c = this.m_oBrush.Color1;
_c.R = r;
_c.G = g;
_c.B = b;
_c.A = a;
this.Native["PD_b_color1"](r,g,b,a);
},
b_color2 : function(r,g,b,a)
......
This diff is collapsed.
......@@ -2014,6 +2014,14 @@ asc_docs_api.prototype["Call_Menu_Event"] = function(type, _params)
_return = _stream;
break;
}
case 202: // ASC_MENU_EVENT_TYPE_DOCUMENT_PDFBASE64
{
var _stream = global_memory_stream_menu;
_stream["ClearNoAttack"]();
_stream["WriteStringA"](this.WordControl.m_oDrawingDocument.ToRenderer());
_return = _stream;
break;
}
case 110: // ASC_MENU_EVENT_TYPE_CONTEXTMENU_COPY
{
_return = this.Call_Menu_Context_Copy();
......
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