obsidian-better-pdf-plugin
obsidian-better-pdf-plugin copied to clipboard
undocumented quirks in page range specification
The following declaration will fail with the specified errors:
{"url": "/assets/pdfs/dek-neo4j-graph-data-modeling.pdf", "page": [[7, 8], 13]}
# PDF Parameters invalid: Unterminated string in JSON at position 80
{"url": "/assets/pdfs/dek-neo4j-graph-data-modeling.pdf", "page": [,[7, 8], 13]}
# PDF Parameters invalid: Unexpected token ',', ..." "page": [,[7, 8], 1"... is not valid JSON
However this one will work:
{"url": "/assets/pdfs/dek-neo4j-graph-data-modeling.pdf", "page": [ [7, 8], 13]}
The example of proper syntax for a multiple-page range gives [1, [3, 6], 8]
but does not specify that the initial entry must be a single page rather than a range of pages.
Faced the same problem and found the issue in code. It is not related to starting with a single page or not.
The issue is double square brackets ("[[" and "]]") are sort of skipped in the JSON parsing as it is used for Obsidian linking. The solution is to add a space in between the double square brackets.
Documenting the behavior or fixing it would be beneficial.