解析带文本的形状时无法获取内部文本位置

你好,Aspose,
现有以下两个问题,从提供的api没有找到解决办法:
1.解析一个椭圆形状时,我们无法获取椭圆内部文本的位置,其它带文本的形状也是一样的。
2.解析标注类型控件时,只能获得主体的位置和大小。
可参见附件中的图形说明

嗨,

感谢您联系支持。

可以请您分享一些细节,重新说明您的要求,因为我们无法从上述声明中确定问题。 还请分享一些有关您需要信息的输入文件格式的详细信息。

PS,根据我们的观察,共享的PDF文档包含一个图像文件。

您好,

非常抱歉给您带来的麻烦,现将问题详细描述如下:

使用场景:我们开发了一款编辑器,支持导入PPT文件并做内容的编辑,这就需要把PPT中的元素解析出来,获取PPT元素的位置、尺寸等等属性数据,然后在我们的软件中用我们的控件来显示。部分PPT元素我们用图片来代替,但有文本的部分必须显示成文本,便于用户再次编辑。

使用的解析方法

Presentation ppt = new Presentation(fileName);

IShape shape = ppt.Slides[0].Shapes[0];

然后直接从shape中获取该形状的相关参数

存在的问题:

1. 解析一个椭圆形状时,我们无法获取椭圆内部文本的位置,其它带文本的形状也是一样的。

例如下面的两个形状,我们能取到内部的文本,但取不到这个文本的起始坐标,这样我们还原的时候就没办法定位文本的位置

2.解析标注类型控件时,只能获得主体的位置和大小,这样我们就没办法准确还原这个形状的大小和位置

非常期待您的回复!

嗨,

我已经尝试从您的意见中观察您的要求,您正在寻找在椭圆形内部封闭文本的绝对位置。不幸的是,我不能完全理解,因为图像链接也是坏的。你可以再次分享图像一起回答我的问题。

非常感谢,

Hello Aspose,

很抱歉,图片上传失败,给您带来了不便。
现将我的问题以附件的形式发给您,请在附件中查收!

您好,
我已经观察到您的要求,并将分别分享两个问题的反馈意见。


1. 解析一个椭圆形状时,我们无法获取椭圆内部文本的位置,其它带文本的形状也是一样的。
例如下面的两个形状,我们能取到内部的文本,但取不到这个文本的起始坐标,这样我们还原的时候就没办法定位文本的位置

我喜欢分享一下Aspose.Slides,让您访问任何形状的段落或部分坐标。 请尝试使用以下示例代码来达成这一目的。 但是,根据值的精度来获取段落文本的坐标值存在一个小问题,您可能需要添加一些偏移值以精确调整值。 我添加了ID SLIDESNET-39014作为增强的一个问题,以进一步改进这一点。


2.解析标注类型控件时,只能获得主体的位置和大小,这样我们就没办法准确还原这个形状的大小和位置

不幸的是,我还没有完全理解这个问题。 您想要获取如图所示的注释区域坐标吗? 请分享信息,以便我在这方面进一步帮助您。

非常感谢,

Hello,

Thanks for your reply.
To help you better understand my questions. I write it again in English more clearly. You can find in the attachment.
Looking forward to your reply.
Thank you!
谢您更加清楚地分享<span style=“font-size:10.0pt;line-height:115%;
font-family:“Courier New”;mso-fareast-font-family:“Times New Roman”;mso-ansi-language:
EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA”>PDF<span style=“font-size:10.0pt;line-height:115%;font-family:“MS Mincho”;
mso-bidi-font-family:“MS Mincho”;mso-ansi-language:EN-US;mso-fareast-language:
ZH-CN;mso-bidi-language:AR-SA” lang=“ZH-CN”>文档。关于在椭圆和箭头形状中获取文本位置的观点,我已经分享了一个<span style=“font-size:10.0pt;line-height:115%;font-family:“Courier New”;mso-fareast-font-family:
“Times New Roman”;mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;
mso-bidi-language:AR-SA”><span style=“font-family:“MS Mincho”;mso-bidi-font-family:“MS Mincho”;
color:blue” lang=“ZH-CN”>示例代
<span style=“font-size:10.0pt;
line-height:115%;font-family:“MS Mincho”;mso-bidi-font-family:“MS Mincho”;
mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA” lang=“ZH-CN”>和<span style=“font-size:10.0pt;line-height:115%;font-family:“Courier New”;mso-fareast-font-family:
“Times New Roman”;mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;
mso-bidi-language:AR-SA”><span style=“font-family:“MS Mincho”;mso-bidi-font-family:“MS Mincho”;
color:blue” lang=“ZH-CN”>源演示文稿
<span style=“font-size:10.0pt;
line-height:115%;font-family:“MS Mincho”;mso-bidi-font-family:“MS Mincho”;
mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA” lang=“ZH-CN”>,以方便我上一篇文章。使用示例代码,您可以在形状内获取文本的大致位置。我已经创建了<span style=“font-size:10.0pt;line-height:115%;font-family:“Courier New”;mso-fareast-font-family:
“Times New Roman”;mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;
mso-bidi-language:AR-SA”>ID SLIDESNET-39014<span style=“font-size:10.0pt;line-height:115%;font-family:“MS Mincho”;mso-bidi-font-family:
“MS Mincho”;mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:
AR-SA” lang=“ZH-CN”>作为增强的问题,以进一步改进文字内部位置值的提取。<span style=“font-size:10.0pt;line-height:115%;font-family:“Courier New”;mso-fareast-font-family:
“Times New Roman”;mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;
mso-bidi-language:AR-SA”>



<span style=“font-size:10.0pt;line-height:115%;font-family:
“MS Mincho”;mso-bidi-font-family:“MS Mincho”;mso-ansi-language:EN-US;
mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA” lang=“ZH-CN”>关于获取标注形状的突出显示部分的位置和大小的要求,我很遗憾分享,目前<span style=“font-size:10.0pt;
line-height:115%;font-family:“Courier New”;mso-fareast-font-family:“Times New Roman”;
mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA”>API<span style=“font-size:10.0pt;line-height:115%;font-family:“MS Mincho”;
mso-bidi-font-family:“MS Mincho”;mso-ansi-language:EN-US;mso-fareast-language:
ZH-CN;mso-bidi-language:AR-SA” lang=“ZH-CN”>中不支持此功能。已经创建了<span style=“font-size:10.0pt;line-height:115%;font-family:
“Courier New”;mso-fareast-font-family:“Times New Roman”;mso-ansi-language:EN-US;
mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA”>ID SLIDESNET-39022<span style=“font-size:10.0pt;line-height:115%;font-family:“MS Mincho”;
mso-bidi-font-family:“MS Mincho”;mso-ansi-language:EN-US;mso-fareast-language:
ZH-CN;mso-bidi-language:AR-SA” lang=“ZH-CN”>的问题,作为提供所需支持的新功能请求。此线程已与问题相关联,以便在支持可用后,您可能会自动收到通知。<span style=“font-size:10.0pt;line-height:115%;font-family:“Courier New”;mso-fareast-font-family:
“Times New Roman”;mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;
mso-bidi-language:AR-SA”>



<span style=“font-size:10.0pt;line-height:115%;font-family:
“MS Mincho”;mso-bidi-font-family:“MS Mincho”;mso-ansi-language:EN-US;
mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA” lang=“ZH-CN”>非常感<span style=“font-size:10.0pt;line-height:115%;font-family:“Courier New”;
mso-fareast-font-family:“Times New Roman”;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA”>,<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val=“–”/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–><!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}

<![endif]–>