ofd-editor ofd在线编辑器介绍

由于ofd标准的数据结构和浏览器的dom数据结构是不一致的,如果直接使用浏览器的dom数据结构,那么ofd的数据结构中的很多信息是无法完全实现出来的。而使用了编辑器组件,就没有这个问题了。因为本质上,编辑器组件就是一个JavaScript的类或对象,可以完整的绑定所有的ofd标准的数据结构,当然也能绑定我们之前创建的虚拟ofd文件,以及虚拟ofd文件的各层的对象。

Web编辑器包括菜单栏、控制栏、内容区、属性栏等高级组件,这些组件本质上都是由编辑器组件的抽象类创建的具体类。

头部菜单栏,包括大纲、页面缩略图、模板缩略图、组织结构等。

文档编辑区,包括Web文档组件(WebDocument),Web页面组件(WebPage),Web图层组件(WebLayer),Web控件组件(WebControl)等层级。

文档编辑区的各个层级对应到ofd文件的各个层级。

在创建相应层级的编辑器对象时,将虚拟ofd文件的对应层级的对象作为参数传入编辑器的层级组件中。传入虚拟ofd文件的相应层级的对象的同时,将其属性转化为该编辑器对应层级的组件的属性。从而使各层级的编辑器组件和ofd文件的文件层次组件结构形成一一对应的映射关系。

文档编辑区执行渲染方法,生成对应的dom树,即可把ofd文件内容在浏览器端渲染出来。

由于文档编辑区已经绑定了虚拟ofd文件,从而可以直接修改虚拟ofd文件,实现ofd的编辑功能了。

右侧属性栏,包括文档属性、页面属性、控件属性等;绑定对应虚拟ofd文件层级的属性。从而能够编辑ofd的其它属性。

资源地址:https://download.csdn.net/download/xjf7711/87393607?spm=1001.2014.3001.5503

效果:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
public int convert2Ofd(int imagefileid, String filename,String docdcsurl) { writeLog("ConvertToPdfForDcsE9--convertUot2Ofd-------------------start"); //String docdcsurl = Util.null2String(getPropValue("yzDcsUrl", "docdcsurl")); writeLog("ConvertToPdfForDcsE9--convertUot2Ofd-------------------imagefileid=" + imagefileid + ";filename=" + filename + ";docdcsurl=" + docdcsurl); int newimagefileid = -1; try { if (imagefileid > 0 && !"".equals(filename) && !"".equals(docdcsurl)) { String fileext = ""; if (filename.indexOf(".") != -1) { fileext = filename.substring(filename.lastIndexOf(".")); } writeLog("ConvertToPdfForDcsE9--convertUot2Ofd-------------------fileext=" + fileext); String sourcefilepath = getImageFile(imagefileid + ""); writeLog("ConvertToPdfForDcsE9--convertUot2Ofd-------------------sourcefilepath=" + sourcefilepath); if (!"".equals(sourcefilepath)) { String dcsurl = convert(docdcsurl, sourcefilepath, "29"); writeLog("ConvertToPdfForDcsE9--convertUot2Ofd-------------------dcsurl=" + dcsurl); if (!"".equals(dcsurl)) { InputStream input = getInputStreamFromDcs(dcsurl); writeLog("ConvertToPdfForDcsE9--convertUot2Ofd-------------------input=" + input); String newfilename = filename.substring(0, filename.lastIndexOf(".")) + ".ofd"; if (input != null) { newimagefileid = savePdfImageFile(input, newfilename); } if (new File(sourcefilepath).exists() && new File(sourcefilepath).isFile()) { new File(sourcefilepath).delete(); } } } } } catch (Exception e) { writeLog("ConvertToPdfForDcsE9--convertUot2Ofd-------------------Exception=" + e); } writeLog("ConvertToPdfForDcsE9--convertUot2Ofd-------------------newimagefileid=" + newimagefileid); writeLog("ConvertToPdfForDcsE9--convertUot2Ofd-------------------end"); return newimagefileid; } 加下注释
06-08

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值