我一直在寻找这个问题但是没有找到任何答案,所以要么我错过了一些如此明显的东西没有人写过任何关于它的东西,或者我遇到了一个不寻常的问题.我希望这是第一次......
我正在使用第三方库(IDMLlib)从以.idml格式存储的Adobe InDesign文档中提取信息.内容很容易读取并存储在"Idml"类型的对象中,其中包含我需要的所有内容.现在,我想使用Jackson JSON将此对象发送到Web客户端(浏览器).
我遇到了两个问题:
1)对象树充满了圆形的引用.我通过使用带有注释的混合来解决这个问题
@JsonIdentityInfo(generator = ObjectIdGenerators.IntSequenceGenerator.class, property = "@id")
Run Code Online (Sandbox Code Playgroud)
所以现在我已经准备好了很多Mix-ins,如果问题2需要的话.
2)序列化时我不断收到新的特定于对象的错误.
--Output from testMethodsReturnsSomething--
| Failure: testMethods(package.IdmlServiceTests)
| com.fasterxml.jackson.databind.JsonMappingException: (was java.lang.NullPointerException) (through reference chain: de.fhcon.idmllib.api.elements.Idml["document"]->de.fhcon.idmllib.api.elements.Document["tags"]->de.fhcon.idmllib.api.elements.tags.Tags["xmltagList"]->java.util.ArrayList[0]->de.fhcon.idmllib.api.elements.tags.XMLTag["tagColor"]->de.fhcon.idmllib.api.elements.typedefs.InDesignUIColorType["greenValue"])
at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:218)
at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:183)
at com.fasterxml.jackson.databind.ser.std.StdSerializer.wrapAndThrow(StdSerializer.java:155)
at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:533)
...
Run Code Online (Sandbox Code Playgroud)
我已经尝试编写自定义NullValue/NullKey序列化程序,但这对NullPointerException没有帮助.
我可以在我的Mix-ins中使用注释来处理这个问题吗?
还是有另一种方法让我序列化这个对象?
我需要处理Indesign Idml文件,生成图像,并在html中的某些元素上覆盖其他元素.
给出Indesign Idml文件(这是一个压缩的xml包)并在该文件中给出一个可视元素(通过xml中的标记).有没有办法找到视觉元素落在图像上的坐标?
我Polygon在 idml 文件中有这个
<Polygon Self="ue7" ContentType="Unassigned" StoryTitle="$ID/" ParentInterfaceChangeCount="" TargetInterfaceChangeCount="" LastUpdatedInterfaceChangeCount="" OverriddenPageItemProps="" HorizontalLayoutConstraints="FlexibleDimension FixedDimension FlexibleDimension" VerticalLayoutConstraints="FlexibleDimension FixedDimension FlexibleDimension" GradientFillStart="0 0" GradientFillLength="0" GradientFillAngle="0" GradientStrokeStart="0 0" GradientStrokeLength="0" GradientStrokeAngle="0" ItemLayer="uc5" Locked="false" LocalDisplaySetting="Default" GradientFillHiliteLength="0" GradientFillHiliteAngle="0" GradientStrokeHiliteLength="0" GradientStrokeHiliteAngle="0" AppliedObjectStyle="ObjectStyle/$ID/[Normal Graphics Frame]" Visible="true" Name="$ID/" ItemTransform="1 0 0 1 41.5 -14.555409553836853">
<Properties>
<PathGeometry>
<GeometryPathType PathOpen="true">
<PathPointArray>
<PathPointType Anchor="105 -258.94488188905" LeftDirection="105 -258.94488188905" RightDirection="105 -171" />
<PathPointType Anchor="105 -168" LeftDirection="105 -257.05511811095" RightDirection="105 -78.94488188905001" />
<PathPointType Anchor="201 -72" LeftDirection="120 -72" RightDirection="282 -72" />
<PathPointType Anchor="338 -209" LeftDirection="338 -167" RightDirection="338 …Run Code Online (Sandbox Code Playgroud) 我正在尝试将c# idml实现为html转换器.我设法生成一个类似于indesign导出的单个平面html文件.
我想做的是生成与html idml查看器一样尽可能类似于indesign视图的html.要做到这一点,我需要找到适合文本框架的文本,我可以提取故事文本内容,但我真的找不到将这些内容拆分成框架/页面的方法.
有什么办法可以实现吗?
我在阅读 IDML 点差时遇到了多种形状。每个形状都有自己的几何形状,看起来像 -
-<PathGeometry>
-<GeometryPathType PathOpen="false">
-<PathPointArray>
<PathPointType RightDirection="-611.5 1548.5" LeftDirection="-611.5 1548.5" Anchor="-611.5 1548.5"/>
<PathPointType RightDirection="-611.5 2339.5" LeftDirection="-611.5 2339.5" Anchor="-611.5 2339.5"/>
<PathPointType RightDirection="-533.3 2339.5" LeftDirection="-533.3 2339.5" Anchor="-533.3 2339.5"/>
<PathPointType RightDirection="-533.3 1548.5" LeftDirection="-533.3 1548.5" Anchor="-533.3 1548.5"/>
</PathPointArray>
</GeometryPathType>
</PathGeometry>
Run Code Online (Sandbox Code Playgroud)
对于矩形来说,这是微不足道的(如上例所示),其中<PathPoint>元素中的每个属性都指向矩形中的一个端点。其他形状会发生什么?换句话说,RightDirection、LeftDirection 和 Anchor 属性表示什么?有没有办法确定它正在查看 PathPointArray 的形状?
谢谢。