ONLYOFFICE / DocumentBuilder

ONLYOFFICE Document Builder is powerful text, spreadsheet, presentation and PDF generating tool
https://www.onlyoffice.com/document-builder.aspx
GNU Affero General Public License v3.0
113 stars 56 forks source link

Api.CreateImage incorrect insert by https url in Web DocumentBuilder 5.1.4 #18

Closed ShockwaveNN closed 6 years ago

ShockwaveNN commented 6 years ago
  1. Send this script to url localhost/docbuilder?async=false
    builder.CreateFile("docx");
    var oDocument = Api.GetDocument();
    var oParagraph, oDrawing;
    oParagraph = oDocument.GetElement(0);
    oDrawing = Api.CreateImage("https://api.onlyoffice.com/content/img/docbuilder/examples/coordinate_aspects.png", 60 * 36000, 35 * 36000);
    oParagraph.AddDrawing(oDrawing);
    builder.SaveFile("docx", "CreateImage.docx");
    builder.CloseFile();
  2. Download created file

In DocumentServer Web Documentbuilder 5.1.3 (and earlier) will be created this file (with correct inserted image) CreateImage (2).docx

In DocumentServer Web Documentbuilder 5.1.4 will be created this file without correct image

May be related with new libcurl lib scheme CreateImage (3).docx

ShockwaveNN commented 6 years ago

Tryed http image link - seems fine on 5.1.4, image inserted correctly

builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph, oDrawing;
oParagraph = oDocument.GetElement(0);
oDrawing = Api.CreateImage("http://i.imgur.com/FwCrqlU.jpg", 60 * 36000, 35 * 36000);
oParagraph.AddDrawing(oDrawing);
builder.SaveFile("docx", "CreateImage.docx");
builder.CloseFile();
ShockwaveNN commented 6 years ago

Fixed in https://github.com/ONLYOFFICE/document-server-package/pull/48 verified in 5.1.4.21