question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Empty PDF after bumping to targetSDK 29

See original GitHub issue

As described on the title, one of the things we’ve noticed so after bumping the targetSDK version of our app to SDK 29, is that it isn’t possible for us to generate a PDF using the RNHTMtoPDF library.

Has anyone else experienced this issue?

PDF file gets created on the given route wit the givenfileName, but its content is empty.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:18 (4 by maintainers)

github_iconTop GitHub Comments

10reactions
ThibaultG1commented, Nov 13, 2020

Hello, As @gundlev said, by forking the repo and copying the fix.

mWebView.loadData(mHtmlString, "text/HTML; charset=utf-8", null); should be replaced by: mWebView.loadDataWithBaseURL(mBaseURL, mHtmlString, "text/HTML", "utf-8", null); in android/src/main/java/android/print/PdfConverter.java.

then replace the react-native-html-to-pdfdependency in the project with your fork. e.g: npm uninstall react-native-html-to-pdf && npm install git+https://github.com/ThibaultG1/react-native-html-to-pdf

3reactions
christopherdrocommented, Jan 5, 2021

@liamjones Thanks. I’ll release a patch for v0.9 with your changes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Environment.getExternalStorageDirectory() deprecated in API ...
I spent a whole afternoon finding out why a certain external library stopped working, as soon as I raised the targetSdk level to...
Read more >
Behavior changes: apps targeting API 29+ - Android Developers
The changes listed in this document apply exclusively to apps that are targeting API 29 or higher. If your app sets targetSdkVersion to...
Read more >
Release Notes - Helpshift for Android - Developer Guide
Fixed a crash which occurred when a user opens the chat screen containing an attachment message and hardware acceleration was explicitly disabled in...
Read more >
Update targetSdkversion to 29 · Issue #3360 · getodk/collect
Working on #3189 we wanted to bump targetSdkversion directly to 29 but it turned out ... Then, when we're ready to target API...
Read more >
Adobe AIR SDK Release Notes
Gamua-372: Changing default Android target SDK to 29 ... AIR-168: AIR content goes all white/blank after AR camera closes (Gamua-67).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found