scerio / packages.flutter Goto Github PK
View Code? Open in Web Editor NEW👨💻 Plugins and packages for Flutter framework
Home Page: https://pub.dev/publishers/serge.software/packages
License: MIT License
👨💻 Plugins and packages for Flutter framework
Home Page: https://pub.dev/publishers/serge.software/packages
License: MIT License
So I made a mistake in writing the file name from the assets and application crashes.
Plugin should probably handle this. I am not sure if the same happens when calling openFile with wrong filePath, but for sure it crashes when using openAsset.
CrashLog:
E/AndroidRuntime(30053): FATAL EXCEPTION: Thread-6
E/AndroidRuntime(30053): Process: org.eldrider, PID: 30053
E/AndroidRuntime(30053): java.io.FileNotFoundException: flutter_assets/assets/pdfs/ELD_Rider_Instructions222.pdf
E/AndroidRuntime(30053): at android.content.res.AssetManager.nativeOpenAsset(Native Method)
E/AndroidRuntime(30053): at android.content.res.AssetManager.open(AssetManager.java:824)
E/AndroidRuntime(30053): at android.content.res.AssetManager.open(AssetManager.java:801)
E/AndroidRuntime(30053): at io.scer.pdf.renderer.NativePDFRendererPlugin.openAssetDocument(NativePDFRendererPlugin.kt:178)
E/AndroidRuntime(30053): at io.scer.pdf.renderer.NativePDFRendererPlugin.access$openAssetDocument(NativePDFRendererPlugin.kt:30)
E/AndroidRuntime(30053): at io.scer.pdf.renderer.NativePDFRendererPlugin$openDocumentAssetHandler$1.run(NativePDFRendererPlugin.kt:86)
E/AndroidRuntime(30053): at java.lang.Thread.run(Thread.java:919)
I/Process (30053): Sending signal. PID: 30053 SIG: 9
Is your feature request related to a problem? Please describe.
We would like to show the user that he is on page 1/n,
Describe the solution you'd like
To achieve that I believe that a simple onPageChanged
callback could be easily implemented and would give us a lot of flexibility.
Describe alternatives you've considered
A built-in page indicator would also work, but might not fit into the UI of every app.
Additional context
Describe the bug
There is no way to catch plugin error.
To Reproduce
Simplest way to reproduce - try to open non existing file.
Expected behavior
It should be possible to catch plugin errors. Example with non existing file is just example, in my case I observe some crashes because of some file format problems in some rare cases in production.
I already tried all 4 possible solution I know to catch dart/flutter errors, none of them works, application just crashes.
native_pdf_view: ^2.2.0
I am trying to switch from pdf_viewer_plugin to your package but I am not able to implement the same user experience as I have in the existing plugin.
What I need is vertical viewer with smooth scrolling. I need the page to load in full available width size (both in portrait and horizontal orientation). I need pinch/zoom possibility. The zoom should not reset when the new page is detected.
Basically, it should look like all pdf pages are merged vertically as the one big page and initially shown in the full available width space, with zoom and pinch possibility.
Can you please help me archive that with your plugin.
Hello dear
Thank you very much for your great work on this project.
i would like to know if you have plan to add text highlight as you know it is necessary for ebook reader.
Also it is necessary to get chapters for example to show it on a drawer for chapter navigations
I can't build apk release (my compileSdkVersion is 29)
I get this error:
FAILURE: Build failed with an exception.
java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
flutter\build\native_pdf_renderer\intermediates\res\merged\release\values\values.xml:236: error: resource android:attr/fontVariationSettings not found.
flutter\build\native_pdf_renderer\intermediates\res\merged\release\values\values.xml:237: error: resource android:attr/ttcIndex not found.
error: failed linking references.
To resolve this error i increase compileSdkVersion in build.gradle of module native_pdf_rendererfrom 27 to 28
I found this solution here
crosswalk-project/cordova-plugin-crosswalk-webview#207 (comment)
So you need to increase compileSdkVersion to 28 in source code.
Thanks
It would be helpful if there was a way to get the currently opened pdf's page count.
At this moment, i'm not sure how one can get this number other than brute forcing by jumping to a page and seeing if the onPageChanged callback is fired or not.
Describe the bug
Forgive my poor english,I want to show the pdf automatic and i used Future.periodic
and pageController.nextPage
api, but how can i get the current show page to stop the animation
or go to the first page?
I would like to have pages render at full screen width when loaded.
is there a standard way to achieve this?
I believe I can use the Custom Page Builder
referenced in the documentation.
However, PdfView.builder
does not seem to be a standard type for this class.
Is there a more complete example showing how to use PdfView.builder
?
Thank you,
Great Package!
Hello. I have a book and it contains 300+ titles. How can I get all of these titles? I want to make a menu of contents.
Can you please explain me how the parameter is used in the loadDocument method:
`
/// Load document
Future loadDocument(Future documentFuture) {
if (_pdfViewState != null) {
return null;
}
_pdfViewState._changeLoadingState(_PdfViewLoadingState.loading);
return _loadDocument(document);
}
`
Describe the bug
Cannot load files with japanese filenames.
To Reproduce
Expected behavior
open file.
Additional context
project works fine when the file is sample.pdf, and even if i change the filename to 123.pdf. but fails when it uses japanese.
Package name
native_pdf_renderer
Describe the solution you'd like
To be able to specify a rectangle in the coordinates of the PDF page to specify what to render.
Describe alternatives you've considered
The alternative is to render the entire page and then copy the part you want.
After installing your package and following the example, the app crashes with the error below
RangeError (index): Invalid value: Valid value range is empty: 0
A method can be added to go to the page that the user chooses.
Epub_view| I have a book with a lot of chapters. How can I search these sections? Thank you.
Describe
The jumpToPage method just doesn't work
To Reproduce
Steps to reproduce the behavior:
import 'package:flutter/material.dart';
import 'package:native_pdf_view/native_pdf_view.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
int _actualPageNumber = 1, _allPagesCount = 0;
PdfController _pdfController;
@override
void initState() {
_pdfController = PdfController(
document: PdfDocument.openAsset('assets/sample.pdf'),
);
super.initState();
}
@override
void dispose() {
_pdfController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) => MaterialApp(
theme: ThemeData(primaryColor: Colors.white),
home: Scaffold(
appBar: AppBar(
title: Text('PdfView example'),
actions: <Widget>[
Container(
margin: EdgeInsets.only(right: 16),
alignment: Alignment.center,
child: Text(
'$_actualPageNumber/$_allPagesCount',
style: TextStyle(fontSize: 22),
),
),
IconButton(
icon: Icon(Icons.navigate_next),
onPressed: () {
_pdfController.jumpToPage(_pdfController.page + 1);
},
)
],
),
body: PdfView(
documentLoader: Center(child: CircularProgressIndicator()),
pageLoader: Center(child: CircularProgressIndicator()),
controller: _pdfController,
onDocumentLoaded: (document) {
setState(() {
_allPagesCount = document.pagesCount;
});
},
onPageChanged: (page) {
setState(() {
_actualPageNumber = page;
});
},
),
),
);
}
Smartphone
The current implementation seems to be only for Android and iOS, is there any way to use this plugin for desktop and web?
Describe the bug
When I open pdf in the landscape mode, only partial of the file is loaded.
Expected behavior
User should be able to view the entire page (probably by scroll up/down)
Smartphone (please complete the following information):
Additional context
Is there a way to workaround this problem? I used the provided example
Package name
A name of package whom this bug concerns. Ex. native_pdf_renderer
Describe the bug
On error in the package the entire app crashes and closes.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Throw a catchable exception
Screenshots
N/A
Smartphone (please complete the following information):
Additional context
Below 3 items that worked OK before the next one caused the error.
D/PDF_RENDER( 3424): OpenFileDocument. File: /data/user/0/za.co.mydomain.myapp/app_flutter/Cache/d503a6e1-4be2-4f33-9504-eb4072c26afb.pdf
D/PDF_RENDER( 3424): OpenFileDocument. File: /data/user/0/za.co.mydomain.myapp/app_flutter/Cache/36d1d5da-2086-4d29-a283-4dbb1615bcbd.pdf
D/PDF_RENDER( 3424): OpenFileDocument. File: /data/user/0/za.co.mydomain.myapp/app_flutter/Cache/b6371a15-b068-497c-a410-98cf9ad9a321.pdf
E/AndroidRuntime( 3424): FATAL EXCEPTION: Thread-7
E/AndroidRuntime( 3424): Process: za.co.mydomain.myapp, PID: 3424
E/AndroidRuntime( 3424): io.scer.pdf.renderer.resources.RepositoryItemNotFoundException: 7c4172e9-dcb7-44b7-99f5-0e5f32822ff7
E/AndroidRuntime( 3424): at io.scer.pdf.renderer.resources.Repository.get(Repository.kt:12)
E/AndroidRuntime( 3424): at io.scer.pdf.renderer.NativePDFRendererPlugin$openPageHandler$1.run(NativePDFRendererPlugin.kt:129)
E/AndroidRuntime( 3424): at java.lang.Thread.run(Thread.java:764)
I/Process ( 3424): Sending signal. PID: 3424 SIG: 9
[!] Unable to determine Swift version for the following pods:
- `native_pdf_renderer` does not specify a Swift version and none of the targets (`Runner`) integrating it have the `SWIFT_VERSION` attribute set. Please contact the author or set the `SWIFT_VERSION` attribute in at least one of the targets that integrate this pod.
what should i do?
Describe the bug
I want to animate or jump to a certain page when document is loaded at the very start of rendering.
To Reproduce
1 - I tried to jump to a certain page when document is loaded in
onDocumentLoaded: (PdfDocument document) { _pdfController.jumpToPage(10); },
But I faced an exception :
Reloaded 9 of 868 libraries in 854ms. D/PDF_RENDER( 6672): OpenFileDocument. File: /data/user/0/projectname/cache/file_picker/Short-stories-from-100-Selected-Stories.pdf E/flutter ( 6672): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: type '_AssertionError' is not a subtype of type 'Exception' �[38;5;248mE/flutter ( 6672): #0 PdfController._loadDocument�[39;49m E/flutter ( 6672): <asynchronous suspension> �[38;5;248mE/flutter ( 6672): #1 PdfController._attach�[39;49m �[38;5;248mE/flutter ( 6672): #2 _PdfViewState.initState�[39;49m �[38;5;244mE/flutter ( 6672): #3 StatefulElement._firstBuild�[39;49m �[38;5;244mE/flutter ( 6672): #4 ComponentElement.mount�[39;49m �[38;5;244mE/flutter ( 6672): #5 Element.inflateWidget�[39;49m �[38;5;244mE/flutter ( 6672): #6 Element.updateChild�[39;49m �[38;5;244mE/flutter ( 6672): #7 SingleChildRenderObjectElement.mount�[39;49m �[38;5;244mE/flutter ( 6672): #8 Element.inflateWidget�[39;49m �[38;5;244mE/flutter ( 6672): #9 Element.updateChild�[39;49m �[38;5;244mE/flutter ( 6672): #10 ComponentElement.performRebuild�[39;49m �[38;5;244mE/flutter ( 6672): #11 Element.rebuild�[39;49m �[38;5;244mE/flutter ( 6672): #12 ComponentElement._firstBuild�[39;49m �[38;5;244mE/flutter ( 6672): #13 ComponentElement.mount�[39;49m �[38;5;244mE/flutter ( 6672): #14 Element.inflateWidget�[39;49m �[38;5;244mE/flutter ( 6672): #15 Element.updateChild�[39;49m �[38;5;244mE/flutter ( 6672): #16 ComponentElement.performRebuild�[39;49m �[38;5;244mE/flutter ( 6672): #17 Element.rebuild�[39;49m �[38;5;244mE/flutter ( 6672): #18 ComponentElement._firstBuild�[39;49m �[38;5;244mE/flutter ( 6672): #19 ComponentElement.mount�[39;49m �[38;5;244mE/flutter ( 6672): #20 Element.inflateWidget�[39;49m �[38;5;244mE/flutter ( 6672): #21 Element.updateChild�[39;49m �[38;5;244mE/flutter ( 6672): #22 ComponentElement.performRebuild�[39;49m �[38;5;244mE/flutter ( 6672): #23 Element.rebuild�[39;49m �[38;5;244mE/flutter ( 6672): #24 ComponentElement._firstBuild�[39;49m �[38;5;244mE/flutter ( 6672): #25 ComponentElement.mount�[39;49m �[38;5;244mE/flutter ( 6672): #26 Element.inflateWidget�[39;49m �[38;5;244mE/flutter ( 6672): #27 Element.updateChild�[39;49m �[38;5;244mE/flutter ( 6672): #28 ComponentElement.performRebuild�[39;49m �[38;5;244mE/flutter ( 6672): #29 Element.rebuild�[39;49m �[38;5;244mE/flutter ( 6672): #30 ComponentElement._firstBuild�[39;49m �[38;5;244mE/flutter ( 6672): #31 ComponentElement.mount�[39;49m �[38;5;244mE/flutter ( 6672): #32 Element.inflateWidget�[39;49m �[38;5;244mE/flutter ( 6672): #33 MultiChildRenderObjectElement.mount�[39;49m �[38;5;244mE/flutter ( 6672): #34 Element.inflateWidget�[39;49m �[38;5;244mE/flutter ( 6672): #35 Element.updateChild�[39;49m �[38;5;244mE/flutter ( 6672): #36 ComponentElement.performRebuild�[39;49m �[38;5;244mE/flutter ( 6672): #37 StatefulElement.performRebuild�[39;49m �[38;5;244mE/flutter ( 6672): #38 Element.rebuild�[39;49m �[38;5;244mE/flutter ( 6672): #39 ComponentElement._firstBuild�[39;49m �[38;5;244mE/flutter ( 6672): #40 StatefulElement._firstBuild�[39;49m �[38;5;244mE/flutter ( 6672): #41 ComponentElement.mount�[39;49m �[38;5;244mE/flutter ( 6672): #42 Element.inflateWidget�[39;49m �[38;5;244mE/flutter ( 6672): #43 Element.updateChild�[39;49m �[38;5;244mE/flutter ( 6672): #44 ComponentElement.performRebuild�[39;49m E/flutter ( 6672): #45 Element.rebuild (package:flutter/src/w
Expected behavior
I expected to open on the page I requested.
Screenshots
Smartphone (please complete the following information):
Package name
native_pdf_renderer v1.3.0+1
Describe the bug
=== BUILD TARGET native_pdf_renderer OF PROJECT Pods WITH CONFIGURATION Release ===
/Users/escolarmanager/work/flutter_plugins_pdf/packages/native_pdf_renderer/ios/Classes/document/Page.swift:59:30: error: 'pngData()' has been renamed to
'UIImagePNGRepresentation(_:)'
data = image.pngData() as Data?
^~~~~~~
UIImagePNGRepresentation
UIKit.UIImage:58:17: note: 'pngData()' was introduced in Swift 4.2
public func pngData() -> Data?
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Successful build
Smartphone (please complete the following information):
Additional context
I was replaced the 59 line of Page.swift file and the build works!!!
original
data = image.pngData() as Data?
suggestion
data = UIImagePNGRepresentation(image)
Could you please publish the correction in pub.dev?
Thanks in advance
Describe the bug
E/AndroidRuntime(14575): FATAL EXCEPTION: Thread-16
E/AndroidRuntime(14575): Process: de.gebatzens.sia, PID: 14575
E/AndroidRuntime(14575): io.scer.pdf.renderer.resources.RepositoryItemNotFoundException: 63c623e9-64e1-4c23-8b18-a28b18d8f27c
E/AndroidRuntime(14575): at io.scer.pdf.renderer.resources.Repository.get(Repository.kt:12)
E/AndroidRuntime(14575): at io.scer.pdf.renderer.NativePDFRendererPlugin$openPageHandler$1.run(NativePDFRendererPlugin.kt:129)
E/AndroidRuntime(14575): at java.lang.Thread.run(Thread.java:919)
I/Process (14575): Sending signal. PID: 14575 SIG: 9
To Reproduce
Steps to reproduce the behavior:
When I open a pdf file with the native_pdf_renderer sometimes it crashes.
Smartphone (please complete the following information):
Describe the bug
My Dismissible widget contains
setState((){
_items.removeAt(index);
})
callback in onDismissed() method.
Previously I used SliverList, and it handled it perfectly -- item was removed without any errors. Now, with AutoAnimatedSliverList(), my onDismissed() method causes whole list to redraw and scroll to top.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expected it to behave as SliverList, handling Dismissible behavior under the hood.
At least it must be explained in documentation on how to solve similar issue, probably using some GlobalKey.
native_pdf_renderer V 1.3.0+1
page.close() does not work. On iOS (not tested on android)
final document = await PDFDocument.openAsset('assets/sample.pdf');
final page = await document.getPage(1);
final pageImage = await page.render(width: page.width, height: page.height);
await page.close();
/// this generates an error: PlatformException(RENDER_ERROR, Unexpected error: ItemNotFound., null)
final page1 = await document.getPage(1);
final pageImage1 = await page1.render(width: page1.width, height: page1.height);
await page1.close();
how can i set childAspectRatio
in LiveGrid
?
can we use this library for StaggeredGridView
?
imageFromPdfFile2(File pdfFile) async {
List<im.Image> imageList = List();
int height = 0, width = 0;
final document = await pdf_ren.PDFDocument.openFile(pdfFile.path);
im.Image imImage;
for (int i = 1; i <= document.pagesCount; i++) {
final page = await document.getPage(i);
final pdfPageImage =
await page.render(width: page.width, height: page.height);
imImage = im.decodeImage(pdfPageImage.bytes); // First issue in this line
height += imImage.height;
width += imImage.width;
imageList.add(imImage);
await page.close();
}
im.Image mergedImage = im.Image(width, height);
// Merge generated image vertically as vertical-orientated-multi-pdf
for (var item in imageList) {
im.copyInto(mergedImage, item, blend: true);
}
savePdfAndImageDB(pdfFile, imImage.getBytes());
}
Please expose the configuration for pageSnapping
Describe the bug
LiveOptions
has to be imported from `package:auto_animated/src/helpers/options.dart.
Expected behavior
Importing package:auto_animated/auto_animated.dart
should make LiveOptions
available.
If I read the new PDF file instead of the existing one (eg. using a StreamBuilder
), already rendered and probably cached pages will not be replaced with the pages from the new file. Only pages not yet visited in the previous PDF will be rendered correctly.
Expected behavior
Loading a new PDF should invalidate previously cached pages.
how i can refresh items with call onRefresh as listView builder dose?
Anyway to customise the PDFView by adding Highlight features in the UIMenuItem during text selected?
Describe the bug
When I try to render a PDF page the App crashes on an iOS device. There is no Exception, only the message :
"Lost connection to device.
Bad state: No element
Bad state: No element
Exited (sigterm)".
On Android this is working fine.
To Reproduce
The App is crashing in line 6
void main() async {
try {
WidgetsFlutterBinding.ensureInitialized();
final document = await PDFDocument.openAsset('assets/hello.pdf');
final page = await document.getPage(1);
final pageImage = await page.render(width: page.width, height: page.height);
await page.close();
runApp(
MaterialApp(
home: Scaffold(
body: Center(
child: Image(
image: MemoryImage(pageImage.bytes),
),
),
),
color: Colors.white,
)
);
} on Exception catch (error) {
print(error);
}
}
Describe the bug
I want to play .xls or .xlxs .doc format file on my device.but i cant find any plugin on flutter to show it.so i just transformed the file to the pdf format, the file transformed from .doc format show nothing error but the file transformed from .xls format shows nothing but white screen(if the font color is black and the background color is white).If I changed the font color to red i can see the word render an red line on the screen.
The file shows no error on my computer.
Smartphone (please complete the following information):
Additional context
I can provide the original file if necessary.
Waiting for u reply.Thx.
Supposedly this only happens in Android Studio 3.5+.
This is based on a post found here https://www.tutorialkart.com/kotlin-android/kotlin-plugin-should-be-enabled-before-kotlin-kapt/
To fix, change the following in build.gradle
BEFORE
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
AFTER
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
error: The argument type 'FadeTransition Function(BuildContext, int, Animation)' can't be assigned to the parameter type 'Widget Function(BuildContext, Animation)'. (argument_type_not_assignable at [xxxxxxx] lib\screens\pages\feeds\followers_feeds_page.dart:81)
code
AnimateIfVisibleWrapper(
// Show each item through (default 250)
showItemInterval: Duration(milliseconds: 150),
child: SingleChildScrollView(
child: Column(
children: <Widget>[
// First item with `FadeTransition` and show duration 500
AnimateIfVisible(
key: Key('item.1'),
duration: Duration(milliseconds: 500),
builder: (
BuildContext context,
int index,
Animation<double> animation,
) =>
FadeTransition(
opacity: Tween<double>(
begin: 0,
end: 1,
).animate(animation),
child: YouFirstWidget(),
),
),
// Second item with `SlideTransition` and show duration 350
AnimateIfVisible(
key: Key('item.2'),
duration: Duration(milliseconds: 350),
builder: (
BuildContext context,
int index,
Animation<double> animation,
) =>
SlideTransition(
position: Tween<Offset>(
begin: Offset(0, -0.1),
end: Offset.zero,
).animate(animation),
child: YouSecondWidget(),
),
),
],
),
),
)
This error occurs if I scroll the page quickly when I finish or before rendering.
D/PDF_RENDER(26338): OpenFileDocument. File: /data/user/0/br.com.bmtcloud.jasaudeanimal/cache/1122734catofos_lamina_mobile.pdf
E/MethodChannel#io.scer.pdf.renderer(26338): Failed to handle method call
E/MethodChannel#io.scer.pdf.renderer(26338): java.lang.IllegalStateException: Current page not closed
E/MethodChannel#io.scer.pdf.renderer(26338): at android.graphics.pdf.PdfRenderer.throwIfPageOpened(PdfRenderer.java:269)
E/MethodChannel#io.scer.pdf.renderer(26338): at android.graphics.pdf.PdfRenderer.close(PdfRenderer.java:184)
E/MethodChannel#io.scer.pdf.renderer(26338): at io.scer.pdf.renderer.document.Document.close(Document.kt:23)
E/MethodChannel#io.scer.pdf.renderer(26338): at io.scer.pdf.renderer.resources.DocumentRepository.close(DocumentRepository.kt:25)
Other stack
D/PDF_RENDER(28542): OpenFileDocument. File: /data/user/0/br.com.bmtcloud.jasaudeanimal/cache/1122734catofos_lamina_mobile.pdf
I/flutter (28542): aqui
E/AndroidRuntime(28542): FATAL EXCEPTION: Thread-35
E/AndroidRuntime(28542): Process: br.com.bmtcloud.jasaudeanimal, PID: 28542
E/AndroidRuntime(28542): java.lang.IllegalStateException: Current page not closed
E/AndroidRuntime(28542): at android.graphics.pdf.PdfRenderer.throwIfPageOpened(PdfRenderer.java:269)
E/AndroidRuntime(28542): at android.graphics.pdf.PdfRenderer.openPage(PdfRenderer.java:224)
E/AndroidRuntime(28542): at io.scer.pdf.renderer.document.Document.openPage(Document.kt:30)
E/AndroidRuntime(28542): at io.scer.pdf.renderer.NativePDFRendererPlugin$openPageHandler$1.run(NativePDFRendererPlugin.kt:129)
Is your feature request related to a problem? Please describe.
Actually I started using this package due to the fact that it uses the native iOS and Android API.
I need to permit user to zoom infinitely on my PDFView
, but now zoom is not simply settable. In some PDF page the actual zoom is not enough.
Describe the solution you'd like
It will be beautiful to add a parameter on PDFView
widget in order to set the maximum PDF zoom/zoomRatio in a simply way. Something like:
return PDFView(
document: snapshot.data,
infiniteZoom: true/false,
// or maxZoomRatio: 4.0,
);
Can it be possible?
Thank you
Package name
A name of package whom this idea concerns. Ex. native_color
zoomable image view
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
I want to zoom in the rendered I tried zoomable image package but as its just image with low pixel I lose pixels
Describe the solution you'd like
A clear and concise description of what you want to happen.
I want to render a high-quality image so no issue for pixel loss or update pixel by taking an image from the zoomable image I mean just Zoomable pdf renderer
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
E/AndroidRuntime(22186): FATAL EXCEPTION: Thread-123
E/AndroidRuntime(22186): Process: com.abcd.bookse, PID: 22186
E/AndroidRuntime(22186): java.lang.IllegalStateException: Current page not closed
E/AndroidRuntime(22186): at android.graphics.pdf.PdfRenderer.throwIfPageOpened(PdfRenderer.java:273)
E/AndroidRuntime(22186): at android.graphics.pdf.PdfRenderer.openPage(PdfRenderer.java:226)
E/AndroidRuntime(22186): at io.scer.pdf.renderer.document.Document.openPage(Document.kt:30)
E/AndroidRuntime(22186): at io.scer.pdf.renderer.NativePDFRendererPlugin$openPageHandler$1.run(NativePDFRendererPlugin.kt:129)
E/AndroidRuntime(22186): at java.lang.Thread.run(Thread.java:764)
E/AndroidRuntime(22186): FATAL EXCEPTION: Thread-125
E/AndroidRuntime(22186): Process: com.anhtudev.bookse, PID: 22186
E/AndroidRuntime(22186): java.lang.IllegalStateException: Current page not closed
E/AndroidRuntime(22186): at android.graphics.pdf.PdfRenderer.throwIfPageOpened(PdfRenderer.java:273)
E/AndroidRuntime(22186): at android.graphics.pdf.PdfRenderer.openPage(PdfRenderer.java:226)
E/AndroidRuntime(22186): at io.scer.pdf.renderer.document.Document.openPage(Document.kt:30)
E/AndroidRuntime(22186): at io.scer.pdf.renderer.NativePDFRendererPlugin$openPageHandler$1.run(NativePDFRendererPlugin.kt:129)
E/AndroidRuntime(22186): at java.lang.Thread.run(Thread.java:764)
I/Process (22186): Sending signal. PID: 22186 SIG: 9
Lost connection to device.
I don't have a need to be notified of onDocumentLoaded and onPageChanged events. Since the arguments are not marked as mandatory I didn't set onDocumentLoaded and onPageChanged.
As I saw your code expects that this callbacks are set and loading document crashes...
You should probably mark fields as mandatory or do a null check in the code before calling methods.
I have two different documents to display.
One in English - doc_en.pdf, and one in German - doc_de.pdf.
In the user settings page of the app, the user can change an instance of UserPrefs.
The mainApp is enclosed with
ChangeNotifierProvider<UserPrefs>.value(
value: userPrefs,
child: MaterialApp(
I have tried several schemes to enclose PdfView
with a Consumer
PdfController pdfController;
Widget _buildPdfView(String documentName) {
if (pdfController != null) {
pdfController.dispose();
}
pdfController =
PdfController(document: PdfDocument.openAsset(documentName));
return PdfView(key: Key('PdfView'), controller: pdfController);
}
Consumer<UserPrefs>(builder: (context, prefs, child) {
String displayPdf =
'assets/pdf/${widget.docTitle}/${widget.docTitle}_${prefs.getLang()}.pdf';
print(displayPdf); // prints correct result
return _buildPdfView(displayPdf);
The document displays properly when the app is started.
However, when the UserPrefs object is changed, the app raises an exception with
════════ Exception caught by widgets library ═══════════════════════════════════
The following NoSuchMethodError was thrown building PdfView-[<'PdfView'>](dirty, dependencies: [_EffectiveTickerMode], state: _PdfViewState#13f6e(ticker inactive and muted)):
The getter 'pagesCount' was called on null.
Receiver: null
Tried calling: pagesCount
Is there a way to use PdfView
inside a Consumer
block?
Describe the bug
If you have an one page pdf and you are scrolling to the top / down, the pdf is cut off, so you can't see the rest of the pdf
To Reproduce
Steps to reproduce the behavior:
Expected behavior
See the entire pdf.
Smartphone (please complete the following information):
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
In first case with the fresh project of Flutter
If i am running from command line then the app is running fine on simulator as well on real device. but i am building and running from Xcode then it is giving me following errors.
Second case is to run with existing application with alot of other plugins
Then the following error is occurring in both cases, either from terminal or from Xcode.
Failed to build iOS app
Error output from Xcode build:
↳
2019-12-05 11:06:42.202 xcodebuild[22067:169419] DTDeviceKit: deviceType from 98762ebee0668151686dd01da2abb6186fc9a98a was NULL
2019-12-05 11:06:42.295 xcodebuild[22067:169419] DTDeviceKit: deviceType from 98762ebee0668151686dd01da2abb6186fc9a98a was NULL
** BUILD FAILED **
Xcode's output:
↳
**flutter_downloader-cravousdkmjzvhbseqbfmbuiktbf
/Users/ars/.pub-cache/hosted/pub.dartlang.org/native_pdf_renderer-1.6.1/ios/Classes/NativePDFRendererPlugin.m:2:9: fatal error: 'native_pdf_renderer/native_pdf_renderer-Swift.h' file not found
#import <native_pdf_renderer/native_pdf_renderer-Swift.h>**
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
flutter_downloader-cravousdkmjzvhbseqbfmbuiktbf
note: Using new build system
note: Planning build
note: Constructing build description
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 6.0, but the range of supported deployment target versions is 8.0 to 13.2.99. (in target 'Reachability' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 4.3, but the range of supported deployment target versions is 8.0 to 13.2.99. (in target 'FMDB' from project 'Pods')
Flutter Doctor
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.9.1+hotfix.6, on Mac OS X 10.15.1 19B88, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
[✓] Android Studio (version 3.5)
[✓] Connected device (2 available)
• No issues found!
ARSs-Mac-mini:portfolio ars$
Following plugins, that i am using
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
flutter_cupertino_localizations: ^1.0.1
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
font_awesome_flutter: "8.5.0"
# flutter_full_pdf_viewer: 1.0.5
flutter_pdfview: 1.0.0+10
path: 1.6.4
path_provider: 0.5.0+1
chewie: 0.9.8
http: 0.12.0+2
json_annotation: ^3.0.0
# simple_permissions:
flutter_downloader: 1.2.2
permission_handler: 3.2.2
bloc: ^0.15.0
equatable: 0.5.1
flutter_bloc: 0.21.0
sqflite: "1.1.6+4"
connectivity: 0.4.4
url_launcher: 5.1.4
flutter_svg: 0.14.2
csv: 4.0.3
spreadsheet_decoder: 1.0.1
pinch_zoom_image: 0.2.5
shared_preferences: ^0.4.3
native_pdf_renderer: ^1.6.1
dev_dependencies:
flutter_test:
sdk: flutter
video_player:
json_serializable: ^3.2.0
Please note: other pdf plugins are commented to use this.
when the pdf file is loaded pages takes time to load even in release which is pretty annoying for book readers and it is even worse for pages that contain images, is there any to make it faster?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.