-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
PDF Preview in VS Code #10821
Comments
This would be great particularly for TeX users. Being able to compile and see the resulting PDF all from within the editor is unvaluable and would definitely attract TeX users to the VSCode community. |
I completely agree. I use VSCode as my primary TeX editor for its simplicity, and would love for it to be able to display PDF files. |
Check this extension- https://marketplace.visualstudio.com/items?itemName=tomoki1207.pdf |
It would be excellent, I use VSCode as my main editor for a lot of things including TeX. I would like to be able to edit & preview my documents in the same editor! |
The extension (https://marketplace.visualstudio.com/items?itemName=tomoki1207.pdf) you mentioned is nice but not perfect. It works perfectly when using its preview mode (right click a pdf file and then select View PDF). However, when you directly open a pdf by clicking the name, you may find that it cannot open many PDF documents. In this direct open mode, the pdf file is firstly loaded as a text file. So it suffers all the limits of reading text files (no binary file, too large size, or wrong encoding). But actually, with pdf.js, only the uri of the pdf is required. I tried to fix this problem and find that vscode has no hook to interrupt the creation of TextDocumentProvider. So the extension cannot work perfectly. I still suggest vscode make a built-in pdf viewer via pdf.js, for better performance. Indeed, it is not very difficult to integrate pdf.js. |
@chengs built-in a new third-party module is quite dangerous, that's why vscode have extension feature. The only problem for this issue is rearding how vscode implement reasourceVIewer, see So far, extensions can only process the file that vscode loaded, which means the pdfviewer extension cannot be opened if vscode do not even load it. If vscode decide to implement a feature that pass the file to extensions before it display a "not open" warning, and check whether there exsists an extension can process the file or not. Then the problem will be simply solved. Related issue: |
Bumping this thread. It's annoying I can't open pdfs natively in VSCode. My workflow would be so much cleaner if I could. |
Bumping again. A reliable *.pdf viewer that would work with synctex would indeed make life easier. |
Bumping again |
We try to keep VS Code lean and we think the functionality you're asking for is great for a VS Code extension. Maybe you can already find one that suits you in the VS Code Marketplace. Just in case, in a few simple steps you can get started writing your own extension. See also our issue reporting guidelines. Happy Coding! |
It would be cool to have a PDF Preview in vs code. We're using vscode to read our documentation repository, and there are still many PDFs from external service providers we have to keep there...
The text was updated successfully, but these errors were encountered: