Git Product home page Git Product logo

openrtf's Introduction

OpenRTF is an open source Java library for RTF (Rich Text Format) files

OpenRTF is a Java library for creating and editing RTF (Rich Text Format) files with a LGPL and MPL open source license. We welcome contributions from other developers. Please feel free to submit pull-requests and bugreports to this GitHub repository.

OpenRTF is branched out of OpenPDF - https://github.com/LibrePDF/OpenPDF

Java CI License (LGPL version 2.1) License (MPL)

Use OpenRTF as Maven dependency

Add this to your pom.xml file to use the latest version of OpenRTF:

<dependency>
    <groupId>com.github.librepdf</groupId>
    <artifactId>openrtf</artifactId>
    <version>1.2.1</version>
</dependency>

Contributing

Release the hounds! Please send all pull requests. Make sure that your contributions can be released with a dual LGPL and MPL license. In particular, pull requests to the OpenRTF project must only contain code that you have written yourself, or copied from a project with the exact same license. GPL or AGPL licensed code will not be acceptable.

Documentation

Hello world

Coding Style

  • Code indentation style is 4 spaces.
  • Generally try to preserve the coding style in the file you are modifying.

Dependencies

Required Dependencies:

openrtf's People

Contributors

andreasrosdal avatar asturio avatar cursor42 avatar dependabot[bot] avatar osobolev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openrtf's Issues

Remove dependency to OpenPDF in pom.xml

Remove dependency to OpenPDF in pom.xml.

Copy the files from OpenPDF, so that OpenRTF can be used without OpenPDF. For example com.lowagie.text.DocWriter and the files it refers to, needs to be copied to OpenRTF.

Read RTF file

I've been struggling with extracting image and text from RTF file , as long as , there is no any code example of reading RTF files in OpenRTF readME . Is it actually possible to extract text and image from RTF file format using this library ?

License discrepancy between OpenPDF & OpenRTF?

Hi,

I don't want to dive in the old license swamp too deep again, so please feel to close this if you consider this a non-issue.

The pom.xml of this project specifies:

    <licenses>
        <license>
            <name>GNU General Lesser Public License (LGPL) version 3.0</name>
            <url>http://www.gnu.org/licenses/lgpl.html</url>
            <distribution>repo</distribution>
        </license>
        <license>
            <name>Mozilla Public License Version 2.0</name>
            <url>http://www.mozilla.org/MPL/2.0/</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

while OpenPDF says:

    <licenses>
        <license>
            <name>GNU Lesser General Public License (LGPL), Version 2.1</name>
            <url>https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html</url>
            <distribution>repo</distribution>
        </license>
        <license>
            <name>Mozilla Public License Version 2.0</name>
            <url>https://www.mozilla.org/en-US/MPL/2.0/</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

Is the difference (LGPL 2.1 vs. LGPL 3.0) something inherited from the old iText stuff, something decided by the maintainers or a honest mistake? Most source files seems to say either version 2 of the License, or any later version., so I suspect this is just an error in the pom,xml?

Not able to add PNG image into RTF

Summary:
It is not possible to add PNG image into RTF document.
Following exception is thrown:

com.lowagie.text.DocumentException: Only BMP, PNG, WMF, GIF and JPEG images are supported by the RTF Writer
	at com.lowagie.text.rtf.graphic.RtfImage.<init>(RtfImage.java:179)
	at com.lowagie.text.rtf.RtfMapper.mapElement(RtfMapper.java:168)
	at com.lowagie.text.rtf.RtfWriter2.add(RtfWriter2.java:186)
	at com.lowagie.text.Document.add(Document.java:302)

Steps to reproduce:
The problem can be reproduce by adding following code into CreateSimpleRTFDocumentTest.java file:

    document.add(new Paragraph("pngnow.png"));
    Image png = Image.getInstance("pngnow.png");
    document.add(png);

The "pngnow.png" file is taken from LibrePDF/OpenPDF source code.

Note: Adding JPG file works without problems.

Edited:
It seems that problem was introduced by this commit in OpenPDF repository. The class PngImage.java (and others) was removed. As a result the method setOriginalType(Image.ORIGINAL_PNG) is now not called at all.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.