Closed pedro93 closed 8 years ago
Can you upload that PDF somewhere and link to it here? It's kind of hard to investigate anything with nothing to go on, as I'm sure you understand. Also, you haven't mentioned which version of Atom you're using, which version of this package, which version of OS you're running, and whether this affect any other files (generated from latex or not). Providing more details would be helpful.
Happy to reopen the issue once you provide more information :v:
Thanks for looking into this!
As requested here is the information: Pdf file - https://feupload.fe.up.pt/get/1cG14LYWo67DEY8 Atom version: 1.3.2 OS version: OS X Yosemite (10.10.5) Version output:
~ $ apm -v
apm 1.4.1
npm 2.13.3
node 0.10.40
python 2.7.10
git 2.4.9
This issue was only detected after generating the pdf from the latex code, though I have rendered a few other latex projects and this is first time it happened. Haven't found this issue with any other pdf files. Happy to provide any additional information if need be.
P.S: Found the following error in the atom dev console, perhaps it may help you
Uncaught (in promise) EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'".
at Function (native)
at Object.PDFFunction_constructPostScriptFromIR [as constructPostScriptFromIR] (file:///Users/pedrosilva/.atom/packages/pdf-view/node_modules/pdfjs-dist/build/pdf.worker.js:5977:16)
at Object.PDFFunction_fromIR [as fromIR] (file:///Users/pedrosilva/.atom/packages/pdf-view/node_modules/pdfjs-dist/build/pdf.worker.js:5659:23)
at Function.ColorSpace_fromIR [as fromIR] (file:///Users/pedrosilva/.atom/packages/pdf-view/node_modules/pdfjs-dist/build/pdf.worker.js:6901:45)
at Function.ColorSpace_parse [as parse] (file:///Users/pedrosilva/.atom/packages/pdf-view/node_modules/pdfjs-dist/build/pdf.worker.js:6859:23)
at next (file:///Users/pedrosilva/.atom/packages/pdf-view/node_modules/pdfjs-dist/build/pdf.worker.js:11495:28)
at file:///Users/pedrosilva/.atom/packages/pdf-view/node_modules/pdfjs-dist/build/pdf.worker.js:11590:19
Thanks! I'm seeing that problem as well -- reopening so that I can close it with a pull request which should fix things.
So, it seems that the first page was triggering some behavior in the pdf.js library which needs to dynamically evaluate code. That's not allowed in Atom by default, so a workaround needs to be used (in the form of the "loophole" library). Couldn't get that to work in the version of pdf.js that was being used for some reason, so I ended up upgrading to a new version of pdf.js which caused new problems. After some jiggery-pokery -- I think this should work now and nothing should be broken.
I've published a new version just now -- can you give it a try and see if things are working for you?
Just updated the package, the following Atom log was given:
[Enter steps to reproduce below:]
Atom Version: 1.3.2 System: Mac OS X 10.10.5 Thrown From: pdf-view package, v0.38.0
Uncaught Error: Unknown action from worker: ready
At /Users/pedrosilva/.atom/packages/pdf-view/node_modules/pdfjs-dist/build/pdf.js:236
Error: Unknown action from worker: ready
at error (/Users/pedrosilva/.atom/packages/pdf-view/node_modules/pdfjs-dist/build/pdf.js:236:9)
at Worker.messageHandlerComObjOnMessage (/Users/pedrosilva/.atom/packages/pdf-view/node_modules/pdfjs-dist/build/pdf.js:1525:7)
-1:07.3.0 tree-view:toggle (atom-workspace.workspace.scrollbars-visible-when-scrolling)
-0:05.5.0 latex:build (atom-text-editor.editor.is-focused)
{
"core": {
"themes": [
"atom-dark-ui",
"sublime-default-syntax"
],
"disabledPackages": [
"double-click-tree-view",
"metrics"
],
"openEmptyEditorOnStart": false,
"packagesWithKeymapsDisabled": [
"tree-view"
]
},
"pdf-view": {}
}
# User
auto-indent, v0.5.0
autohide-tree-view, v0.25.1
build, v0.52.0
emmet, v2.3.17
language-latex, v0.6.1
latex, v0.28.2
linter, v1.11.3
pdf-view, v0.38.0
project-manager, v2.6.5
sublime-default-syntax, v0.2.7
sync-settings, v0.6.0
tab-close-double-click, v1.0.1
# Dev
No dev packages
Strange -- I'm not seeing that. Can you describe what exactly you did to trigger that error? Starting from the moment you opened Atom? Do you see that error when you just open other PDF files?
I had to restart Atom, it seems to be working. Thank you very much for fixing this :pray: Perhaps something in the atom core had to reboot. If any error pops up, I will be sure to say it. You may close the issue
Ahh, great :D :sweat_smile: Thanks for letting me know.
Hi, I am using atom to write a latex document, however the very frontpage does not seem to be rendered in the pdf viewer. Using the default previewer in my mac the file output is as expected.
The atom previewer:
vs my previewer:
No errors or warnings are given.