loilo-pdf

Pdfium-Based PDF Rendering Engine compatible with Android 4.4

License

License

Categories

Categories

PDF Data
GroupId

GroupId

tv.loilo.pdf
ArtifactId

ArtifactId

pdfcompat
Last Version

Last Version

2.0.0
Release Date

Release Date

Type

Type

aar
Description

Description

loilo-pdf
Pdfium-Based PDF Rendering Engine compatible with Android 4.4
Project URL

Project URL

https://github.com/loilo-inc/loilo-pdf
Source Code Management

Source Code Management

https://github.com/loilo-inc/loilo-pdf

Download pdfcompat

How to add to project

<!-- https://jarcasting.com/artifacts/tv.loilo.pdf/pdfcompat/ -->
<dependency>
    <groupId>tv.loilo.pdf</groupId>
    <artifactId>pdfcompat</artifactId>
    <version>2.0.0</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/tv.loilo.pdf/pdfcompat/
implementation 'tv.loilo.pdf:pdfcompat:2.0.0'
// https://jarcasting.com/artifacts/tv.loilo.pdf/pdfcompat/
implementation ("tv.loilo.pdf:pdfcompat:2.0.0")
'tv.loilo.pdf:pdfcompat:aar:2.0.0'
<dependency org="tv.loilo.pdf" name="pdfcompat" rev="2.0.0">
  <artifact name="pdfcompat" type="aar" />
</dependency>
@Grapes(
@Grab(group='tv.loilo.pdf', module='pdfcompat', version='2.0.0')
)
libraryDependencies += "tv.loilo.pdf" % "pdfcompat" % "2.0.0"
[tv.loilo.pdf/pdfcompat "2.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

loilo-pdf

An Open Source PDF Rendering Library for Android based on pdfium @ AOSP. This library was developed because of need for compatibility of PdfRenderer class with previous version of android.

Compatibility

Currently >= 4.4 (API Level 19)

Usage

This library is fully compatible with PdfRenderer class which is available from Android 5.0 (lollipop).

// pdf file
File file = new File("file.pdf");
try (ParcelFileDescriptor fd = ParcelFileDescriptor.open(file,ParcelFileDescriptor.MODE_READ_ONLY);
     PdfRendererCompat renderer = new PdfRendererCompat(fd);
) {
    for (int i = 0; i < renderer.getPageCount(); i++) {
        try(PdfRendererCompat.Page page = renderer.openPage(i)){
             Bitmap out = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888);
             Matrix mat = new Matrix();
             mat.setScale(2,2);
             page.render(out, null, mat, PdfRendererCompat.Page.RENDER_MODE_FOR_DISPLAY);
        }
    }
}

Install

PdfRenderer is available on Marven Central.

via Gradle


dependencies {
  compile 'tv.loilo.pdf:pdfcompat:2.0.0'
}

Original Pdfium Library

This library is forked from original pdfium library in AOSP, version of refs/tags/android-7.1.1_r6.

LICENSE

Apache License Version 2.0

tv.loilo.pdf

LoiLo inc.

Versions

Version
2.0.0
1.0.0