Commit 017bc0fa authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander.Trofimov

печать для chromium версии

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@62304 954022d7-b5bf-4e40-9824-e11837661b57
parent ad43a578
...@@ -3557,6 +3557,30 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -3557,6 +3557,30 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
var _printPagesData = this.wb.calcPagesPrint(_adjustPrint); var _printPagesData = this.wb.calcPagesPrint(_adjustPrint);
var isEndPrint = _api.wb.printSheet(_printer, _printPagesData); var isEndPrint = _api.wb.printSheet(_printer, _printPagesData);
if (undefined === _printer && _page === undefined)
{
if (undefined !== window["AscDesktopEditor"])
{
var pagescount = _printer.DocumentRenderer.m_lPagesCount;
window["AscDesktopEditor"]["Print_Start"](this.documentUrl, pagescount);
for (var i = 0; i < pagescount; i++)
{
var _start = _printer.DocumentRenderer.m_arrayPages[i].StartOffset;
var _end = _printer.DocumentRenderer.Memory.pos;
if (i != (pagescount - 1))
_end = _printer.DocumentRenderer.m_arrayPages[i + 1].StartOffset;
window["AscDesktopEditor"]["Print_Page"](oDocRenderer.Memory.GetBase64Memory2(_start, _end - _start));
}
window["AscDesktopEditor"]["Print_End"]();
}
return;
}
return _printer.DocumentRenderer.Memory; return _printer.DocumentRenderer.Memory;
}; };
......
...@@ -5549,6 +5549,48 @@ window["asc_docs_api"].prototype["asc_nativeCalculate"] = function() ...@@ -5549,6 +5549,48 @@ window["asc_docs_api"].prototype["asc_nativeCalculate"] = function()
window["asc_docs_api"].prototype["asc_nativePrint"] = function(_printer, _page) window["asc_docs_api"].prototype["asc_nativePrint"] = function(_printer, _page)
{ {
if (undefined === _printer && _page === undefined)
{
if (undefined !== window["AscDesktopEditor"])
{
var _drawing_document = this.WordControl.m_oDrawingDocument;
var pagescount = _drawing_document.SlidesCount;
window["AscDesktopEditor"]["Print_Start"](this.DocumentUrl, pagescount);
var oDocRenderer = new CDocumentRenderer();
oDocRenderer.VectorMemoryForPrint = new CMemory();
var bOldShowMarks = this.ShowParaMarks;
this.ShowParaMarks = false;
oDocRenderer.IsNoDrawingEmptyPlaceholder = true;
for (var i = 0; i < pagescount; i++)
{
oDocRenderer.Memory.Seek(0);
oDocRenderer.VectorMemoryForPrint.ClearNoAttack();
oDocRenderer.BeginPage(_drawing_document.m_oLogicDocument.Width, _drawing_document.m_oLogicDocument.Height);
this.WordControl.m_oLogicDocument.DrawPage(i, oDocRenderer);
oDocRenderer.EndPage();
window["AscDesktopEditor"]["Print_Page"](oDocRenderer.Memory.GetBase64Memory());
}
if (0 == pagescount)
{
oDocRenderer.BeginPage(_drawing_document.m_oLogicDocument.Width, _drawing_document.m_oLogicDocument.Height);
oDocRenderer.EndPage();
window["AscDesktopEditor"]["Print_Page"](oDocRenderer.Memory.GetBase64Memory());
}
this.ShowParaMarks = bOldShowMarks;
window["AscDesktopEditor"]["Print_End"]();
}
return;
}
var _logic_doc = this.WordControl.m_oLogicDocument; var _logic_doc = this.WordControl.m_oLogicDocument;
_printer.BeginPage(_logic_doc.Width, _logic_doc.Height); _printer.BeginPage(_logic_doc.Width, _logic_doc.Height);
_logic_doc.DrawPage(_page, _printer); _logic_doc.DrawPage(_page, _printer);
......
...@@ -846,6 +846,8 @@ function CMetafile(width, height) ...@@ -846,6 +846,8 @@ function CMetafile(width, height)
// просто чтобы не создавать каждый раз // просто чтобы не создавать каждый раз
this.m_oFontSlotFont = new CFontSetup(); this.m_oFontSlotFont = new CFontSetup();
this.LastFontOriginInfo = { Name : "", Replace : null }; this.LastFontOriginInfo = { Name : "", Replace : null };
this.StartOffset = 0;
} }
CMetafile.prototype = CMetafile.prototype =
...@@ -1504,6 +1506,7 @@ CDocumentRenderer.prototype = ...@@ -1504,6 +1506,7 @@ CDocumentRenderer.prototype =
this.m_arrayPages[this.m_arrayPages.length] = new CMetafile(width,height); this.m_arrayPages[this.m_arrayPages.length] = new CMetafile(width,height);
this.m_lPagesCount = this.m_arrayPages.length; this.m_lPagesCount = this.m_arrayPages.length;
this.m_arrayPages[this.m_lPagesCount-1].Memory = this.Memory; this.m_arrayPages[this.m_lPagesCount-1].Memory = this.Memory;
this.m_arrayPages[this.m_lPagesCount-1].StartOffset = this.Memory.pos;
this.m_arrayPages[this.m_lPagesCount-1].VectorMemoryForPrint = this.VectorMemoryForPrint; this.m_arrayPages[this.m_lPagesCount-1].VectorMemoryForPrint = this.VectorMemoryForPrint;
this.Memory.WriteByte(CommandType.ctPageStart); this.Memory.WriteByte(CommandType.ctPageStart);
......
...@@ -7704,6 +7704,40 @@ window["asc_docs_api"].prototype["asc_nativeCalculate"] = function() ...@@ -7704,6 +7704,40 @@ window["asc_docs_api"].prototype["asc_nativeCalculate"] = function()
window["asc_docs_api"].prototype["asc_nativePrint"] = function(_printer, _page) window["asc_docs_api"].prototype["asc_nativePrint"] = function(_printer, _page)
{ {
if (undefined === _printer && _page === undefined)
{
if (undefined !== window["AscDesktopEditor"])
{
var _drawing_document = this.WordControl.m_oDrawingDocument;
var pagescount = Math.min(_drawing_document.m_lPagesCount, _drawing_document.m_lCountCalculatePages);
window["AscDesktopEditor"]["Print_Start"](this.DocumentUrl, pagescount);
var oDocRenderer = new CDocumentRenderer();
oDocRenderer.VectorMemoryForPrint = new CMemory();
var bOldShowMarks = this.ShowParaMarks;
this.ShowParaMarks = false;
for (var i = 0; i < pagescount; i++)
{
oDocRenderer.Memory.Seek(0);
oDocRenderer.VectorMemoryForPrint.ClearNoAttack();
var page = _drawing_document.m_arrPages[i];
oDocRenderer.BeginPage(page.width_mm, page.height_mm);
this.WordControl.m_oLogicDocument.DrawPage(i, oDocRenderer);
oDocRenderer.EndPage();
window["AscDesktopEditor"]["Print_Page"](oDocRenderer.Memory.GetBase64Memory());
}
this.ShowParaMarks = bOldShowMarks;
window["AscDesktopEditor"]["Print_End"]();
}
return;
}
var page = this.WordControl.m_oDrawingDocument.m_arrPages[_page]; var page = this.WordControl.m_oDrawingDocument.m_arrPages[_page];
_printer.BeginPage(page.width_mm, page.height_mm); _printer.BeginPage(page.width_mm, page.height_mm);
this.WordControl.m_oLogicDocument.DrawPage(_page, _printer); this.WordControl.m_oLogicDocument.DrawPage(_page, _printer);
......
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