Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author horiyuki

    (@horiyuki)

    Check for valid pdf file url in file parameter.

    An Example as below.

    [jupdf-viewer file=https://whitebase.org/jupdf/perl-sample.pdf]
    Thread Starter ramonjosegn

    (@ramonjosegn)

    Yes is correct, I am using SZ-Google (PDF viewer and anthers options), could be a conflict with this plugin?

    The plugin show

    PDF.js v? (build: ?)
    Mensaje: Unexpected server response (0) while retrieving PDF “https://whitebase.org/jupdf/perl-sample.pdf”.

    Thanks for support

    Plugin Author horiyuki

    (@horiyuki)

    Thanks for reporting.

    Maybe… Are you tring to load a remote pdf document?

    If you want to display remotely-hosted pdf document,
    the following configuration values are necessary.

    Access-Control-Allow-Origin "*"
    Access-Control-Allow-Headers "range"
    Access-Control-Expose-Headers "content-range, content-length, accept-ranges"
    Access-Control-Allow-Methods "GET"

    For example, write the following setup at .htaccess file on
    the remote host (referenced pdf documents were saved).

    Header append Access-Control-Allow-Origin "*"
    Header append Access-Control-Allow-Headers "range"
    Header append Access-Control-Expose-Headers "content-range, content-length, accept-ranges"
    Header append Access-Control-Allow-Methods "GET"

    Best regards,

    References
    * Content-Length header exposed in CORS configuration for remote docs breaks PDF viewer #4530 https://github.com/mozilla/pdf.js/issues/4530
    * Can I load a PDF from another server (cross domain request)? https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#faq-xhr

    Thread Starter ramonjosegn

    (@ramonjosegn)

    Ye, I am loading files in load remote hosting, because I not have much space on my website.

    ?Not possible in a new update this option (not writting htaccess)?

    Thanks

    Plugin Author horiyuki

    (@horiyuki)

    naruhodo…

    To display remote hosted pdf document cause touble…
    But this problem is very simple.
    Please check http headers I posted before.

    Another solution is for only your www browser.
    Restart your www browser with the following options (in chrome case).

    chrome.exe --allow-file-access-from-files --disable-web-security

    Have a fun.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Not working’ is closed to new replies.