Rank: Newbie
Groups: Guest
Joined: 1/24/2017(UTC) Posts: 2
|
Object ExceptionType : "System.InvalidOperationException" Message : "TextRenderer cannot write a text bitmap because it is empty" StackTrace : " at Aurigma.GraphicsMill.AjaxControls.VectorObjects.TextRenderer.GetTextBitmap(BaseTextVObject vObject, Single dpi, Point location, Boolean extendBitmap, String& id) ↵ at Aurigma.GraphicsMill.AjaxControls.VectorObjects.TextRenderer.RenderToFile(BaseTextVObject vObject, Single dpi) ↵ at Aurigma.GraphicsMill.AjaxControls.VectorObjects.Service.UpdateTextVObject(BaseTextVObject vObject, ICanvas canvas) ↵ at Aurigma.GraphicsMill.AjaxControls.VectorObjects.Service.UpdateByBoundedTextVObjectData(String canvasData, String vObjectData)" Edited by user Sunday, February 5, 2017 10:20:28 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 7/28/2003(UTC) Posts: 1,660
Thanks: 5 times Was thanked: 76 time(s) in 74 post(s)
|
Could you post a small code sample to reproduce the problem? |
Best regards, Fedor Skvortsov
|
|
|
|
Rank: Newbie
Groups: Guest
Joined: 1/24/2017(UTC) Posts: 2
|
Code:var text = new Aurigma.GraphicsMill.AjaxControls.VectorObjects.BoundedTextVObject();
var objectName = 'text' + uniqueId;
var sameNameObjectCount = canvasViewer.get_canvas().get_layers().getVObjectsByName(objectName)[0];
if (sameNameObjectCount)
{
alert("The field has already been inserted into the business card.");
}
else
{
text .set_text("AJAX Vector Objects");
text .set_rectangle(new Aurigma.GraphicsMill.AjaxControls.VectorObjects.Math.RotatedRectangleF(200, 100, 150, 100));
text .set_alignment(Aurigma.GraphicsMill.AjaxControls.VectorObjects.TextAlignment.Center);
text.set_borderWidth(0);
text.set_name(objectName);
layer.get_vObjects().add(text);
var index = text.get_index();
if (index > 0)
{
canvasViewer.get_canvas().CurrentVObjectIndex=index;
canvasViewer.get_canvas().get_currentVObject();
}
}
error occurs on the layer.get_vObjects().add(text); and text.set_fontname function is not defined , so i use text.get_font().set_PostscriptName("Tahoma'); instead. So as the text .set_fontSize(20); function is not defined
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 7/28/2003(UTC) Posts: 1,660
Thanks: 5 times Was thanked: 76 time(s) in 74 post(s)
|
Hey, To fix the problem you shouldn't use the constructor without parameters: Code:var text = new Aurigma.GraphicsMill.AjaxControls.VectorObjects.BoundedTextVObject("AJAX Vector Objects", new Aurigma.GraphicsMill.AjaxControls.VectorObjects.Math.RectangleF(200, 100, 150, 100), "Tahoma", 20);
|
Best regards, Fedor Skvortsov
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.