This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Notification

Icon
Error

Options
Go to last post Go to first unread
kyorilys1  
#1 Posted : Wednesday, February 1, 2017 1:33:23 AM(UTC)
kyorilys1

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

Fedor  
#2 Posted : Wednesday, February 1, 2017 1:36:00 AM(UTC)
Fedor

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

kyorilys1  
#3 Posted : Sunday, February 5, 2017 10:19:22 PM(UTC)
kyorilys1

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

Fedor  
#4 Posted : Wednesday, February 8, 2017 8:53:18 PM(UTC)
Fedor

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

Users browsing this topic
Guest (3)
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.