Comments (12)
Do you use FutureBuilder ?
from packages.flutter.
yes, i copied the example
from packages.flutter.
the pdf file i'm trying to display is from device's storage not assets, can that be the issue?
from packages.flutter.
I don't think there is a problem with this. I use a similar method and I have no performance issues. I must mention that I am working on large pdf files.
!!! You should try the release version for full performance.
PDFDocument _document;
Future<PDFDocument> _getDocument() async {
return _document = await PDFDocument.openFile(your path+ "/file.pdf");
}
FutureBuilder<PDFDocument>(
future: _getDocument(),
builder: (_, snapshot) {
if(snapshot.hasdata) {
return PDFView()... }
}
)
from packages.flutter.
@Fethi1 where you run project? On real device in debug mod or emulator in debug mode?
from packages.flutter.
i run it on a real device, i have tried it on both debug and release and in different phones and the same thing happen, especially for pages that has images, it takes some time to load.
the app i'm developing is supposed to fetch pdf files on device and display each file on a new Route
from packages.flutter.
You can play with render option (render docs)
PDFView(
controller: pageController,
renderer: (PDFPage page) => page.render(
// for example set to 1.25-1.5
// the quality of the final result may decrease
width: page.width * 2,
height: page.height * 2,
format: PDFPageFormat.JPEG,
backgroundColor: '#FFFFFF',
),
);
pages are converted to an image and part of the time is spent on transfer from dart side to platform and back
from packages.flutter.
@SergeShkurko it seems converted page to an image spent lots of time when i use animateToPage
or other animation api .There is a black area on the bottom.what should i do to solve the problem?
from packages.flutter.
@SergeShkurko please change the example as I described in #46 (comment)
You shouldn't load the PDF this way into a FutureBuilder
. This results in many repeated calls to the function and is discouraged in the Flutter documentation (yes, I know it's cached in a variable but still, this is not the suggested way of handling it).
from packages.flutter.
@atheist1 usage jumpTo or minimize delay
from packages.flutter.
@deakjahn i change api un 3.0.0, it is no longer required
from packages.flutter.
option renderer was not working until 3.0.0, now fixed
from packages.flutter.
Related Issues (20)
- Error: Type 'DecoderCallback' not found. HOT 2
- 3.16.0 version flutter compilation failed HOT 2
- PdfControllerPinch.calculatePageFitMatrix RangeError (length): Invalid value: Not in inclusive range 0..1: -1
- PDFX: Downgrade uuid back to ^3.0.6 HOT 6
- : error G5FE39F1E: Type 'DecoderCallback' not found. HOT 4
- PdfViewPinch flicks and auto scroll to top on web HOT 1
- Type 'DecoderCallback' not found. HOT 2
- Getting `Error: Type 'DecoderCallback' not found.` Error when upgrade flutter to 3.16.0 HOT 2
- New Pub.dev package release with latest fix are planed ? HOT 32
- Error: Type 'DecoderCallback' not found - PDFX - Flutter HOT 2
- PDFX not works in Flutter 3.16.3 when use data type Uint8List HOT 9
- Preload some pages
- Publish new version to pub.dev HOT 1
- Rendering on Android blocks UI HOT 3
- Add page flip animation
- not working for windows HOT 1
- Linux Support
- update `ReadMe` with the correct import
- Error in Pdfx v2.5.0: 'DecoderCallback' Type Issue in PdfPageImageProvider HOT 5
- Unable to run on Flutter Version >= 3.15 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from packages.flutter.