legalthings / pdf.js-viewer

Compiled version of pdf.js viewer, modified to run embedded
Apache License 2.0
45 stars 55 forks source link

viewer.less @pdfjsImagePath #15

Open Paulsky opened 7 years ago

Paulsky commented 7 years ago

Hello,

In my project I would like to set a custom pdfjsImagePath. This is my current code: globalVars: {pdfjsImagePath: '/resources/pdfjs/images'}

I think this should work. However, I get an error when compiling the viewer.less file to CSS. The error is expected ')' got '/'. I think this is because the URL function doesn't include quotes. If I surround the string by quotes, the compiling succeeds. Like this:

border-image: url(@pdfjsImagePath/shadow.png) 9 9 repeat; to border-image: url('@pdfjsImagePath/shadow.png') 9 9 repeat;

Should this be the fix? Or should I set the pdfJsImagePath variable on a different way?

jasny commented 7 years ago

@Paulsky Thanks for the bug report. A PR would be fantastic.

Paulsky commented 7 years ago

@jasny I created a PR. Could you please review it?

CasperWSchmidt commented 6 years ago

I can confirm that this PR does fix the problem.

BUT: There's a single reference to loading-icon.gif in the less file that has a hardcoded value "images/loading-icon.gif" instead of @pdfjsImagePath. This should be fixed as well :)

Paulsky commented 6 years ago

Thank you for your reply @CasperWSchmidt . Could you give me the line number please? I searched for '.gif', but I can't see any hardcoded value in the .less file.

CasperWSchmidt commented 6 years ago

@Paulsky the less file is a mess, but try looking for loading-icon: image (screenshot is from viewer.css in your commit)

CasperWSchmidt commented 6 years ago

Oh nvm @Paulsky. I think you did fix it in your PR, but I simply did the same replacement in my local file and overlooked this change :)