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

Invalid Pdf Structure #35

Open
Lzm010409 opened this issue Mar 26, 2023 · 1 comment
Open

Invalid Pdf Structure #35

Lzm010409 opened this issue Mar 26, 2023 · 1 comment

Comments

@Lzm010409
Copy link

Hi,
I've a little issue implementing your Vaadin Component.
I would like to display a pdf on my page. Unfortunately the log always shows me the error "invalid Pdf structure". At first I thought it might be due to the presence of form fields. Then I tried to display a simple document using your PDF viewer, but without success. I have also tried both input methods: StreamRessource and Absolute path of the file. Unfortunately without success. I would really like to use your extension, especially because we work a lot with pdfs, but unfortunately I don't really get anywhere.
I have attached the code snipped and also some screenshots, maybe you can find the time to give me a short feedback.

`PdfViewer pdfViewer = new PdfViewer();

    pdfViewer.setSrc("/Users/lukegollenstede/Downloads/Rechnung_3692157276.pdf");
    pdfViewer.setSizeFull();
    add(pdfViewer);`

Bildschirm­foto 2023-03-26 um 16 48 56

Bildschirm­foto 2023-03-26 um 16 47 50

Thank you in advance...

@paodb
Copy link
Collaborator

paodb commented May 30, 2023

Hello, did you take a look at the examples on the demo on how the resource is set? See example and files location.

If you wish to use the setSrc method only setting an url for the file please take in consideration that the file should be on the same server as where the component is run, so that's why your test is not working. Something like this pdfViewer.setSrc("/frontend/pdf/example.pdf"); where the frontend folder path is src\main\resources\META-INF\resources\frontend should work.

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