New Visual Studio Code extension supporting PDF syntaxThe new VSCode extension by the PDF Association provides PDF syntax awareness to this popular editor, and is designed to support those learning PDF as a page description language.
The PDF Association is pleased to announce the immediate availability of a unique Visual Studio Code "pdf-cos-syntax" extension supporting a wide range of software developers.
This extension extends the popular programming editor with detailed PDF syntax awareness and a rich feature set, designed to support both those learning PDF as a page description language as well as more experienced developers looking for ways to write targeted PDF test files. Although PDF is technically not a pure text format, creating and experimenting with simple PDF files that are text-based is a great way to understand PDF - and adding this extension into the VSCode development environment now makes this even easier.
At a high level, the features of the PDF COS syntax support extension for VSCode include:
- Color-coded syntax highlighting
- An outline tree navigation view of the PDF file showing the physical file layout, including incremental updates
- Basic file problem reporting and highlighting, to help identify invalid files
- Support for folding (e.g., collapse/expand) blocks of syntax so you can focus on what’s important
- Auto-completion of first-class key names defined in PDF 2.0
- Bracket and paired symbol matching
- Toggling comments on and off for selected lines
- Hover hints, to aid understanding
- "Go-to" functionality to facilitate locating all indirect references to an object, to locate an object from a cross-reference table entry, and to locate the cross-reference entry for an object
- Snippets, for easy creation of new example PDF files or new objects
- Various custom commands to make the creation of text-centric PDF files easy, such as the insertion of Image XObjects from local image files (JPEG, PNG, etc.) with the conversion of stream data to ASCII-85 or ASCII-Hex (the two text-based filters supported by PDF).
What this extension will NOT do
This extension will not provide any rendered views of pages in the PDF, or an interactive PDF viewing experience.
Other VSCode extensions already provide this functionality, or an external PDF application can be used, however features and compliance may vary. Developers with appropriate PDF viewing and rendering technologies are encouraged to support PDF developers by providing their own VSCode extensions.
Wait! There's more (to come)...
The above release is only the beginning. Stay tuned for more results from the PDF Association’s multi-year project sponsored by Adobe, Apryse, and Foxit to develop new resources derived from - and enhancing - the PDF specification.
Click on the Extensions icon on the left panel in VSCode, and enter "
pdf-cos-syntax". Then simply click the "Install" button. From this point forward, opening any PDF or FDF file will enable full access to the rich functionality provided by this extension.
If you are not familiar with Visual Studio Code, then grab the PDF cheat sheet of the Visual Studio Code key bindings for your platform. While you're at it, also grab a copy of the PDF Association's PDF cheat sheets to help you get started.
Just a taste... hover hints!
The following screenshots provide a sense of just some of how the extension's hover hints can improve developer awareness and understanding.
Object numbers when hovering over cross-reference entries:
Object numbers and corresponding line numbers when hovering over
Binary bit-mask display when hovering over a bit mask key name:
ASCII displayed when hovering over a hexadecimal string:
This material is based upon work supported by the Defense Advanced Research Projects Agency (DARPA) under Contract No. HR001119C0079. Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the Defense Advanced Research Projects Agency (DARPA). Approved for public release.