stephanrauh / ngx-extended-pdf-viewer

A full-blown PDF viewer for Angular 16, 17, and beyond
https://pdfviewer.net
Apache License 2.0
486 stars 184 forks source link

Minimal project #2010

Closed milossramek closed 11 months ago

milossramek commented 11 months ago

I've studied the PdfShowcase documentation quite thoroughly, but I think I miss something basic. The tutorial on https://pdfviewer.net/extended-pdf-viewer/getting-started starts with

  1. Open a terminal and navigate to the root folder of your project.

But which project? I do not have any. Could you please give me some hints how to get a minimal angular project ( I assume I need one) and what to do next?

Thank you in advance for your help Milos

stephanrauh commented 11 months ago

This makes sense. You're right, when I wrote the documentation, I assumed you've already got an Angular project.

Did you already install Angular? If so, you're only one step away:

If you haven't installed Angular yet, run a quick Google search, but the gist of it is this:

As for the --standalone bit in the first step: that's a current bug of my schematics that I'm fixing this evening.

stephanrauh commented 11 months ago

I've already closed the ticket. Nonetheless, if you've still got questions, don't hesitate to tell me.

milossramek commented 11 months ago

Thank you for your super fast response. It works now. Just one more question: How do I specify options? I've tried to add them, as recommended, to <ngx-extended-pdf-viewer ...> but they seem to be ignored (viewer buttons remain the same): <ngx-extended-pdf-viewer [src]="'/assets/pdfs/9zvazok-kok-kra.pdf'"> [textLayer]="true" [showToolbar]="true" [showSidebarButton]="true" [showFindButton]="true" [showPagingButtons]="true" [showDrawEditor]="false" [showStampEditor]="false" [showTextEditor]="false" [showZoomButtons]="false" [showPresentationModeButton]="false" [showOpenFileButton]="false" [showPrintButton]="false" [showDownloadButton]="true" [showSecondaryToolbarButton]="true" [showRotateButton]="false" [showHandToolButton]="true" [showScrollingButton]="false" [showSpreadButton]="false" [showPropertiesButton]="false"> ~

stephanrauh commented 11 months ago

You've got a closing > before the attributes. I guess they are rendered as plain text. :)

milossramek commented 11 months ago

Oh, thank you. A really stupid bug :( They were not rendered as text.

stephanrauh commented 11 months ago

No worries, we've all been there. :)

BTW, when I wrote my answer this noon, I already suspected you don't see the text because it's hidden by the PDF viewer. But more likely than not, the properties have been rendered in the HTML code.

Be that as it may, I'm glad you've solved your issue!

RitikRajvanshi commented 7 months ago

I got error when I simply put this <ngx-extended-pdf-viewer [src]="'/assets/pdf/anypdf.pdf'">, imported as you recommended. First, it shows a "miniature of the page" and shows error NG0500: During hydration, Angular expected a comment node but found . Annotation 2024-03-26 184341

stephanrauh commented 7 months ago

@RitikRajvanshi "Hydration" sounds like server-side rendering. That's a different topic. Can you open a new bug, please, and add a reproducer - i.e. a minimal project I can get up and running in five minutes and that shows the bug?

Thanks in advance, Stephan

RitikRajvanshi commented 7 months ago

I have a question, I want a dynamic value to send or add in textLayer(in search bar) with two-way binding. How I do it here.Also give me an idea how to show document outline in any pdf.

stephanrauh commented 7 months ago

I'm afraid I don't get the question.