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

Warning: TT: undefined function: 32 VM_Unknown:1 #10288

Closed
robeverett opened this issue Nov 22, 2018 · 3 comments
Closed

Warning: TT: undefined function: 32 VM_Unknown:1 #10288

robeverett opened this issue Nov 22, 2018 · 3 comments

Comments

@robeverett
Copy link

This browser error occurs in the debug console when running Angular 7 app in VS code.
Code:

import { PDFDocumentProxy, PdfViewerComponent } from 'ng2-pdf-viewer';

relevant link:
https://medium.com/factory-mind/angular-pdf-forms-fa72b15c3fbd

There is no support available on that link, though I would love to get it working in my project because it looks great.

Also if someone could explain what the 'ugly cast' contribution means in this line of code, I'd be happy to help, because that might be the source of the error!

`loadComplete(pdf: PDFDocumentProxy): void {

for (let i = 1; i <= pdf.numPages; i++) {

  // track the current page...
  let currentPage = null;

  if (i == 2){ // temp dev solution...
    pdf.getPage(i).then(p => {
      currentPage = p;
      console.log('currentPage ', p);
      return p.getAnnotations();

    }).then(ann => {

      // ugly cast due to missing typescript definitions - please contribute to complete @types/pdfjs-dist
      const annotations = (<any>ann) as PDFAnnotationData[];

      annotations.filter(a => a.subtype === 'Widget') // get the form field annotation only
        .forEach(a => {
          // get the rectangle that represents the single field
          // and resize it according to the current DPI
          console.log('rectangle of field ', a);

          const fieldRect = currentPage.getViewport(this.dpiRatio).convertToViewportRectangle(a.rect);

          // add the corresponding input
          this.addInput(a, fieldRect);
        })
    });
  } 
}

}`

@Snuffleupagus
Copy link
Collaborator

This browser error occurs in the debug console when running Angular 7 app in VS code.
Code:

import { PDFDocumentProxy, PdfViewerComponent } from 'ng2-pdf-viewer';

We (obviously) cannot provide support for third-party libraries that use/embed the PDF.js project in various ways, hence this issue is invalid; please contact the maintainer of the "ng2-pdf-viewer" project for support questions related to using it.

Furthermore, most (if not all) of the information requested https://github.com/mozilla/pdf.js/blob/master/.github/ISSUE_TEMPLATE.md is missing in this issue. Also, note that as clearly explained in https://github.com/mozilla/pdf.js/blob/master/.github/CONTRIBUTING.md, code snippets are not useful.

@robeverett
Copy link
Author

As pointed out, there is no project support available for that link !!!

I guess the reason it's so difficult to work with anything other than read-only PDFs is that Adobe have locked it down because they charge a fortune for anything other than the free adobe viewer for windows 10

@timvandermeij
Copy link
Contributor

Closing since this is a duplicate of #3768. In particular the comment at #3768 (comment) is relevant here. Moreover, no PDF file is provided to reproduce the issue, as well as the other details from the issue template. If need be, you can get support for that external library at https://github.com/VadimDez/ng2-pdf-viewer.

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

3 participants