Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[native_pdf_view] Annotations are not displayed in Android #100

Open
AminYaghouti opened this issue Jul 16, 2020 · 4 comments
Open

[native_pdf_view] Annotations are not displayed in Android #100

AminYaghouti opened this issue Jul 16, 2020 · 4 comments

Comments

@AminYaghouti
Copy link

This is not Problem in Web but in Android Annotations and Comments and Signatures are not displayed.
in Android : (https://user-images.githubusercontent.com/62253599/87638928-dac0e680-c744-11ea-99a2-4c847a65d15e.png)
Main PDF: (https://user-images.githubusercontent.com/62253599/87638956-e57b7b80-c744-11ea-9ba2-9f9e0013bc78.png)
My Code:

     _pdfController = PdfController(
                  document:  PdfDocument.openData(value),
                );
     PdfView(
              pageBuilder: (pdfPageImage,flg,animation){
                Animation<double> _doubleTapAnimation;
                void Function() _animationListener;
                return SingleChildScrollView(
                      scrollDirection: Axis.vertical,
                      child: Container(
                          decoration: BoxDecoration(
                              color: Colors.grey,
                              boxShadow: [
                                BoxShadow(
                                    offset: new Offset(1.0,1.0),
                                    blurRadius: 5.0,
                                    color: Colors.black
                                )
                              ]
                          ),
                          child:ExtendedImage.memory(
                            pdfPageImage.bytes,
                            key: Key(pdfPageImage.hashCode.toString()),
                            fit: BoxFit.contain,
                            mode: ExtendedImageMode.gesture,
                            initGestureConfigHandler: (_) => GestureConfig(
                              minScale: 1,
                              maxScale: 3.0,
                              animationMinScale: .75,
                              animationMaxScale: 3.0,
                              speed: 1,
                              inertialSpeed: 100,
                              inPageView: true,
                              initialScale: 1.0,
                              cacheGesture: false,

                            ),
                            onDoubleTap: (ExtendedImageGestureState state) {
                              final pointerDownPosition = state.pointerDownPosition;
                              final begin = state.gestureDetails.totalScale;
                              double end;

                              _doubleTapAnimation?.removeListener(_animationListener);

                              animation
                                ..stop()
                                ..reset();

                              if (begin == _doubleTapScales[0]) {
                                end = _doubleTapScales[1];
                              } else {
                                if (begin == _doubleTapScales[1]) {
                                  end = _doubleTapScales[2];
                                } else {
                                  end = _doubleTapScales[0];
                                }
                              }

                              _animationListener = () {
                                state.handleDoubleTap(
                                    scale: _doubleTapAnimation.value,
                                    doubleTapPosition: pointerDownPosition);
                              };
                              _doubleTapAnimation = animation
                                  .drive(Tween<double>(begin: begin, end: end))
                                ..addListener(_animationListener);

                              animation.forward();
                            },
                          )
                      )

                  );
              },
              documentLoader: Center(child: CircularProgressIndicator()),
              pageLoader: Center(child: CircularProgressIndicator()),
              controller: _pdfController,
              onPageChanged: (page) {
              },
            )
@AminYaghouti AminYaghouti changed the title Annotation are not displayed in Android Annotations are not displayed in Android Jul 16, 2020
@SergeShkurko
Copy link
Member

@AminYaghouti
if I understand correctly:

  • works fine on the web
  • does not work on android
    right?

@AminYaghouti
Copy link
Author

Exactly, the Problem is only in Android.
You can see that in the photos.

@SergeShkurko
Copy link
Member

@AminYaghouti

Can you attach file for test? Have you tested on ios, works correctly?

@AminYaghouti
Copy link
Author

I haven't tested on ios.
The problem is when the PDF has Combobox,TextField,...
it does not display Values of Combobox and TextField.
ComboTest_Complete.pdf

@SergeShkurko SergeShkurko changed the title Annotations are not displayed in Android [native_pdf_view] Annotations are not displayed in Android Aug 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants