AutoSize property
AutoSize property
Hi
I'm currently adding annotations via XML, and bumped into some problems regarding AutoSize.
If AutoSize isn't the last tag in the XML, Width and Height will be set to 0. I managed to fix that by setting AutoSize as the last tag.
Now it seems though that the width and height isn't changed even though i have set AutoSize to true.
Am i doing something wrong or is AutoSize only used in DocuViewer to change the size of the textbox?
Kind regards,
Kevin
I'm currently adding annotations via XML, and bumped into some problems regarding AutoSize.
If AutoSize isn't the last tag in the XML, Width and Height will be set to 0. I managed to fix that by setting AutoSize as the last tag.
Now it seems though that the width and height isn't changed even though i have set AutoSize to true.
Am i doing something wrong or is AutoSize only used in DocuViewer to change the size of the textbox?
Kind regards,
Kevin
Re: AutoSize property
Hi Kevin,
Could you provide a code snippet or a standalone application that reproduces the issue and demonstrates how you are adding the annotation?
Kind regards,
Loïc
Could you provide a code snippet or a standalone application that reproduces the issue and demonstrates how you are adding the annotation?
Kind regards,
Loïc
Re: AutoSize property
Actually I think I've understood what the problem was. The next minor version should fix it.
Kind regards,
Loïc
Kind regards,
Loïc
Re: AutoSize property
First off we use Fabricjs for the UI.
When we then try to save the image, we add the all data to an collection, accordingly to the documentation of GdPicture (The right properties etc.)
When all the annotations are added to the collection, we then send it over to the server through WCF and try to add the annotations with annotation manager.
Example of the XML that comes from annotationDTO.GetWriter()
If I change the width to for instance to 1, i would assume that since AutoSize is set to true that it automatically change the width accordingly to the width of the text. But it doesn't
Kind regards,
Kevin
When we then try to save the image, we add the all data to an collection, accordingly to the documentation of GdPicture (The right properties etc.)
Code: Select all
collection.Add(new AnnotationTypeTextDTO()
{
Id = Guid.NewGuid().ToString(),
Left = ScaleAndConvertToInches(ratio, (Pixel)(obj.CenterX + additionalWidth / 4)),
Top = ScaleAndConvertToInches(ratio, (Pixel)(obj.CenterY + additionalHeight / 4)),
Width = ScaleAndConvertToInches(ratio, (Pixel)(obj.Width + additionalWidth)),
Height = ScaleAndConvertToInches(ratio, (Pixel)(obj.Height + additionalHeight)),
Rotation = obj.Angle,
Opacity = 1,
StrokeColor = ConvertColorToInt(obj.IETextStroke),
BorderWidth = ScaleAndConvertToInches(ratio, (Pixel)obj.IETextStrokeWidth),
FontColor = ConvertColorToInt(obj.Fill),
FillColor = ConvertColorToInt(obj.IETextBackground),
Alignment = GetTextAlign(obj.TextAlign),
FontStyle = GetFontStyle(obj),
RadiusFactor = 0,
Visible = true,
Fill = obj.IETextBackground == "rgba(0, 0, 0, 0)" || obj.IETextBackground == "transparent" ? false : true,
Stroke = obj.Fill == "rgba(0, 0, 0, 0)" || obj.Fill == "transparent" ? false : true,
Zorder = zOrder,
FontSize = Math.Floor(obj.FontSize / ratio),
FontName = obj.FontFamily,
Text = obj.Text,
AutoSize = true,
});
Code: Select all
foreach (IAnnotationDTO annotationDTO in Collection)
{
Handle.Get().AddAnnotationFromXML(annotationDTO.GetWriter());
}
Example of the XML that comes from annotationDTO.GetWriter()
Code: Select all
<Annotation>
<Type>AnnotationTypeText</Type>
<Text>Test4</Text>
<FontName>Times New Roman</FontName>
<FontStyle>Regular</FontStyle>
<FontSize>138</FontSize>
<ForeColor>-65536</ForeColor>
<CanEditText>True</CanEditText>
<ID>8244994b-a027-42a7-8266-6debe39157d6</ID>
<Top>5.2</Top>
<Left>10.1</Left>
<Width>13.8</Width>
<Height>2.2</Height>
<FlipX>False</FlipX>
<FlipY>False</FlipY>
<Rotation>0</Rotation>
<Zorder>1</Zorder>
<CanMove>True</CanMove>
<CanResize>False</CanResize>
<CanRotate>False</CanRotate>
<CanSelect>True</CanSelect>
<Printable>True</Printable>
<Visible>True</Visible>
<Opacity>1</Opacity>
<Fill>True</Fill>
<FillColor>0</FillColor>
<Stroke>True</Stroke>
<StrokeColor>0</StrokeColor>
<BorderWidth>0.2</BorderWidth>
<CreationTime>01-01-0001 00:00:00</CreationTime>
<ModificationTime>01-01-0001 00:00:00</ModificationTime>
<PreventBurning>False</PreventBurning>
<RadiusFactor>0</RadiusFactor>
<SquaredBox>False</SquaredBox>
<AutoSize>True</AutoSize>
</Annotation>
Kind regards,
Kevin
Re: AutoSize property
Oh nice. When would that be if I may ask?Loïc wrote:Actually I think I've understood what the problem was. The next minor version should fix it.
Kind regards,
Loïc
Kind regards,
Kevin
Re: AutoSize property
Hi Kevin,
We've just published the new update. Could you try it and let me know how things are now from your end?
Kind regards,
Loïc
We've just published the new update. Could you try it and let me know how things are now from your end?
Kind regards,
Loïc
Re: AutoSize property
Hi Loïc
I have performed various test, and it works
Thank you very much for solving the issue so quickly.
Have i nice weekend.
Kind regards,
Kevin
I have performed various test, and it works
Thank you very much for solving the issue so quickly.
Have i nice weekend.
Kind regards,
Kevin
Re: AutoSize property
You are very welcome Kevin!
Thank you for the return and have a nice week-end too!
Cheers,
Loïc
Thank you for the return and have a nice week-end too!
Cheers,
Loïc
Re: AutoSize property
Hi Loïc
Unfortunately i found a issue regarding AutoSize.
When I align my text in the center or right, the width of the textannotation box is not right
Kind regards,
Kevin
Unfortunately i found a issue regarding AutoSize.
When I align my text in the center or right, the width of the textannotation box is not right
Kind regards,
Kevin
Re: AutoSize property
Hi Kevin,
Could you open a ticket on our helpdesk by providing all required information to be able to reproduce the issue from our end?
Here you go: https://www.gdpicture.com/support/getting-support-from-our-team
With best regards,
Loïc
Could you open a ticket on our helpdesk by providing all required information to be able to reproduce the issue from our end?
Here you go: https://www.gdpicture.com/support/getting-support-from-our-team
With best regards,
Loïc
Who is online
Users browsing this forum: No registered users and 0 guests