Giter Site home page Giter Site logo

douglasjunior / react-native-pdf-renderer Goto Github PK

View Code? Open in Web Editor NEW
112.0 3.0 2.0 48.54 MB

⚛ A zoomable, blazing fast, zero dependencies, pure native, typed PDF Renderer for Android and iOS.

License: MIT License

JavaScript 2.90% Ruby 2.02% Java 60.38% Objective-C 23.40% TypeScript 11.31%
android ios pdf pdfkit pdfrenderer react-native

react-native-pdf-renderer's Introduction

Github stats

Hi 👋!

I'm Douglas Nassif, a software engineer passionate about technology and the art of software development. I graduated in Internet Systems Technology at UTFPR, and I've been on this software development journey since 2010.

Throughout my career, I've explored a wide variety of technologies across different domains, including backend, frontend, mobile, and embedded systems. In recent years, I've particularly focused on JavaScript/TypeScript, React, React Native, and NodeJS.

During this time, I've also been involved in creating and maintaining some open-source packages on GitHub, where I dedicate a good portion of my free time.

Currently, I hold the position of Lead Software Development Engineer at DB1, where I lead teams on projects ranging from fintechs to specialized systems for precision agriculture.

React Native

React Native Keyboard Manager React Native Simple Dialogs React Native Get Location React Native rEcaptcha That Works React Native Pdf Renderer React Native Gradient Shimmer React Native App Lifecycle

React JS

React rEcaptcha That Works

Node JS

Ignore dependency postinstall scripts

Android

Android Simple Tooltip Android Bluetooth Library

Electron

E-Mage


Github trophy

My Skills

react-native-pdf-renderer's People

Contributors

douglasjunior avatar marllonfrizzo 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-native-pdf-renderer's Issues

Crash with `width: '100%', height: '100%'`

  • How did you link to the library (autolinking, manual, rn link, cocoapods)?
    • autolinking
  • What version of React Native?
    • 0.71.4
  • What version of the library?
    • 1.0.2
  • iOS/Android version?
    • IOS 16.2
  • Did the problem happen after updating React Native?
    • no
  • Are you using the library for the first time?
    • yes
  • It's a bug? Provide a link to a minimal reproduction case.
<PdfRendererView
      source={value}
      style={{borderRadius: 30, width: '100%', height: '100%'}}
    />

crashes with style width: '100%', height: '100%'
borderRadius,backgroundColor are ignored as well if singlePage={false}

0   yliyo                      	       0x102fcc7a8 -[RNPdfRendererModule handlePageChange:] + 512 (RNPdfRendererModule.m:55)
1   yliyo                      	       0x102fcc79c -[RNPdfRendererModule handlePageChange:] + 500 (RNPdfRendererModule.m:55)

Support Fabric and RCT_NEW_ARCH_ENABLED=1

Currently, the PDF loader component breaks if the new architecture/fabric is enabled in the project. Following error is displayed.

image

  • How did you link to the library (autolinking, manual, rn link, cocoapods)?
    pod install autolinks.
  • What version of React Native?
    Using RN 0.71.7
  • What version of the library?
    "react-native-pdf-renderer": "^1.0.5",
  • iOS/Android version?
    Both Versions
  • Did the problem happen after updating React Native?
    Yes, Fabric and new Architecture support are related. Same issue observed in similar libs like "react-native-pdf": "^6.6.2".
  • Are you using the library for the first time?
    YES
  • It's a bug? Provide a link to a minimal reproduction case.
    Not a bug per say, but a feature support request. To reproduce, bootstrap a fresh RN project with above version, and enable Fabric and new Architecture with RCT_NEW_ARCH_ENABLED=1 pod install

#PS, thank you for the lib.

IllegalStateException - cannot load page

Facing issues with certain Users -
android.graphics.pdf.PdfRenderer in nativeOpenPageAndGetSize

react-native-pdf-renderer - 1.1.1
react - 18.2.0
react-native - 0.71.5

Requirement :
Please provide a callback such as onError to handle such a case.

Scrolling is too fast when zoomed in

Whenever I zoom in the pdf and try scrolling, the pdf scrolls too fastly

Demo :

Record_2023-05-30-22-52-35.mp4

Kindly try to make the scrolling speed normal when the pdf is zoomed it

"RNPdfRendererView" was not found in the UIManager.

  • How did you link to the library (autolinking, manual, rn link, cocoapods)?

Autolinking

  • What version of React Native?

"react-native": "0.72.6"

  • What version of the library?

"react-native-pdf-renderer": "^1.2.0",

  • iOS/Android version?

Both

  • Did the problem happen after updating React Native?

No

  • Are you using the library for the first time?

Yes

  • It's a bug? Provide a link to a minimal reproduction case.

Not sure. Followed the code sample

export function FileView() {
  const { fileUri, isFetching, actionLoading, footerProps, handleOnLayout } = useFileViewer();

  return (
    <AnimatedScrollLayout
      header={{ title: 'Test', showTitle: true, icon: DawnFiles }}
      footer={footerProps}
      onLayout={handleOnLayout}
      loadingProps={{
        isFetching: isFetching || actionLoading,
        bgColor: Colour.White[100],
        dotColor: 'dark',
      }}
      containerStyle={{ backgroundColor: Colour.White[100] }}
    >
      <PdfRendererView
        style={FileViewStyles.webView}
        source={fileUri}
        distanceBetweenPages={16}
        maxZoom={5}
      />
    </AnimatedScrollLayout>
  );
}

File download with expo-file-system

    try {
      setIsFetching(true);
      const fileLocation = getFilePath(fileName);
      const response = await FileSystem.downloadAsync(apiUrl, fileLocation, {
        headers: {
          Authorization: `Bearer ${token}`,
          Prefer: 'return=representation',
        },
      });

      setFileUri(response.uri);
    } catch (error) {
      captureException(error);
      Alert.alert('Error', 'There was an error downloading the file.');
    } finally {
      setIsFetching(false);
    }

Also, I'm running the app locally using Expo GO. Am I missing something on the setup? Any help would be appreciated!

ArithmeticException - divide by zero

On Certain devices getting Issue
com.github.douglasjunior.reactNativePdfRenderer.modules.b in onSizeChanged at line 6

Mostly reported on Android 11 devices.

react-native-pdf-renderer - 1.1.1
react - 18.2.0
react-native - 0.71.5

Add top and bottom components

It would be nice if we could add components to be rendered before and after pdf content and this content will be scrolled with pdf.
E.g: If I render a button at bottom this button will only be visible when I reach the end of PDF content.

It will be something like this:

<Pdf 
  source='...' 
  header={<>This will be rendered before pdf</>}
  footer={<>This will only be visible when reach end of pdf content</>}
  ... other props
/>

I don't know if this is possible to be done but it's a nice feature

Horizontal Scrolling

Hey,

I was wondering if you are open to adding horizontal scrolling to this module or if you want to keep it simple?

I'm asking because with PdfKit these things are quite trivial, but on Android it would require a few more adjustments.

Best,
Finn

PDF resolution very low under Android

When viewing a PDF inside Android (Android 14 was tested), the PDF resolution is very low. It's barely noticeable when the whole PDF page is displayed at once, but once you zoom in to actually read text, the text becomes very hard to read due to the text consisting mostly of pixels.

  • How did you link to the library (autolinking, manual, rn link, cocoapods)?
    autolinking

  • What version of React Native?
    0.73.5

  • What version of the library?
    1.2.0

  • iOS/Android version?
    Tested and found the issue under Android 14.
    iOS Seems to be fine

  • Did the problem happen after updating React Native?
    No

  • Are you using the library for the first time?
    Yes

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.