rtf

Convert RTF File into HTML in Objective C

喜你入骨 提交于 2019-12-10 11:29:06
问题 How can I convert an RTF file into an HTMLformat ?? I have a text editor which saves the file in rtf format but I need to put the contents on my server. For that I need to convert the rtf file into that of an html.. I am unable to find any help with regards to Objective C . Thanks. 回答1: I don't know of any library in objective-c that does rtf to html conversion. However if you are able to perform the conversion server side then that opens up a lot more possibilities, such as php and c#

Insert string with special characters into RTF

家住魔仙堡 提交于 2019-12-09 19:27:45
问题 How to programatically insert string with special characters into RTF? I have rtf template I load to string and then replace all $MY_VARIABLE$ with data. Data contains special chars like 'ąęść' and the problem is that in result file these characters are replaced with '?'. It's something wrong with encoding but what? My code looks like: StreamReader reader = new StreamReader("template.rtf"); StringBuilder form = new StringBuilder(reader.ReadToEnd()); // here I replace variables in rtf with

Convert HTML to RTF (HTML2RTF converter) [closed]

末鹿安然 提交于 2019-12-09 07:20:21
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I'm looking for a simple HTML2RTF converter that I can use on my website which is using a *nix like Operating System. I haven't found

RTF to PDF in Java

守給你的承諾、 提交于 2019-12-09 03:38:46
问题 We are building an application which partially interacts with other system. We are pulling some data from the other system which is returned as RTF document. But we have to prevent users from editing this file, so we thought about converting it with iText into PDF. Code snippet: // moving the rtf data into input stream to be used in RTF parser ByteArrayInputStream rtfInputStream = new ByteArrayInputStream(rtfStream.toByteArray()); // set headers resp.setHeader("Cache-Control", "no-store");

How to convert HTML ==> RTF in Java?

心已入冬 提交于 2019-12-08 16:39:33
问题 The basic API of JAVA that uses RTFEditorKit and HTMLEditorKit, is not able of recognize tags like <br/> and <table> . So I have searched on internet a better way of converting HTML to RTF and i have found two solutions that seem to work. JODConverter and HTML-to-RTFconverter. The first one needs OppenOffice installed to work and the second one uses DLL, so it can’t be used on Linux. Does anyone know about other solution? Thanks for any help!!!! 回答1: Do they want it in RTF or do they want it

JAVA读取RTF文档

女生的网名这么多〃 提交于 2019-12-08 15:12:00
RTF,全称是“富文本格式“,它便于在应用程序之间轻松的转换文本和图形。想了解RTF文件基本格式及相关可以点击 这里 。 需要注意的是,在RTF文件中,对于占双字节的中文,都是用单字节的ASCII字符表示,例如文本“宋体ABC”应该表示为:\'cb\'ce\'cc\'e5ABC, 这种编码我们称之为“汉字机内码”,简称“内码”。把国标码的汉字代码中的区码与位码分别换算为16进制数,然后再分别加上十六进制数80, 即为该汉字的机内码。由于内码的编码方式,所以我们最好在读取RTF文件流的时候将两个字节合并成单个16进制字符,然后在write的时候 将其转换成unicode编码,才能显示成中文字符。 以下有示例代码仅供参考: ( 注意 :这里只解析中文字符,对于单字节字符由于不是内码方式编码,所以是读取不到的) package jj.RTF; /** * 解析RTF文件 * @author jj * */ import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java

JAVA读取RTF格式word文档

倖福魔咒の 提交于 2019-12-08 15:08:45
JAVA利用API中自带的RTFEditorKit类对RTF格式的word文档读取过程中容易出现乱码! 可以利用new String(字符串.getBytes("ISO8859-1"),"GBK");解决文件乱码错误 import javax.swing.text.DefaultStyledDocument; import javax.swing.text.rtf.RTFEditorKit; import java.io.FileInputStream; import java.io.InputStream; import java.io.File; String buffer = ""; //根据文件路劲创建文件,并判断文件是否存在 File file = new File(path); if(!file.exists()){ return buffer; } DefaultStyledDocument styledDoc = new DefaultStyledDocument(); // 创建文件输入流 InputStream streamReader = new FileInputStream(new File(path)); new RTFEditorKit().read(streamReader, styledDoc, 0); //解决编码问题 buffer = new

Java读取word文档解决方案

浪子不回头ぞ 提交于 2019-12-08 15:07:04
java读取word文档时,虽然网上介绍了很多插件poi、java2Word、jacob、itext等等,poi无法读取格式(新的API估计行好像还在处于研发阶段,不太稳定,做项目不太敢用);java2Word、jacob容易报错找不到注册,比较诡异,我曾经在不同的机器上试过,操作方法完全一致,有的机器不报错,有的报错,去他们论坛找高人解决也说不出原因,项目部署用它有点玄;itxt好像写很方便但是我查了好久资料没有见到过关于读的好办法。经过一番选择还是折中点采用rtf最好,毕竟rtf是开源格式,不需要借助任何插件,只需基本IO操作外加编码转换即可。rtf格式文件表面看来和doc没啥区别,都可以用word打开,各种格式都可以设定。 ----- 实现的功能:读取rtf模板内容(格式和文本内容),替换变化部分,形成新的rtf文档。 ----- 实现思路:模板中固定部分手动输入,变化的部分用$info$表示,只需替换$info$即可。 1、采用字节的形式读取rtf模板内容 2、将可变的内容字符串转为rtf编码 3、替换原文中的可变部分,形成新的rtf文档 主要程序如下: /** * 将制定的字符串转换为rtf编码 */ public String bin2hex(String bin) { char[] digital = "0123456789ABCDEF".toCharArray();

How do I create page numbers in XSLT?

女生的网名这么多〃 提交于 2019-12-08 05:44:35
问题 Ive created a c# application which gets an xml file and a xslt file and creates an rtf document. This rtf document is to have a header a footer and page numbers but I can't figure out how to do this in xslt. Anyone have any advice? 回答1: If you specifically need something to be used in XSL, then you can have a block in the footer region (xsl-region-after) and within that block you can have this snippet. <fo:block text-align="right"><fo:page-number format="1"/><fo:page-number-citation format="1

Delphi 7 TRichTextEdit Text in a box not displaying correctly

别来无恙 提交于 2019-12-08 02:25:25
问题 Using delphi 7 TRichEdit component, RTF data is being imported from a msword document through copy and paste, but if data is contained in a box, it is not displaying correctly i.e. Please assist 回答1: Try to use the following, it should subclass the TRichEdit class to version 4.1. However I don't know if Delphi 7 supports interposed classes, so just try to paste the following code and try to build the project. If it compiles then if you put a TRichEdit component and run the project you should