obsidian-notes/代码/pdf页码跳转.md
CSSC-WORK\murmur 3e6078442b init version
2024-04-15 11:19:57 +08:00

35 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: pdf页码跳转
updated: 2022-01-14 05:47:30Z
created: 2022-01-13 00:47:30Z
---
==经验证以下方法无效==
默认pdf文件仅在浏览器下支持页码定位、跳转。[语法#链接本地文件](../工具/Markdown/语法.md#链接本地文件)
通过利用程序启动参数功能可调用浏览器打开pdf间接实现跳转。
核心代码如下:
```
var arg = _ARGV[1];
var procs = process.popen("cmd.exe");
procs.write("start iexplore " ++ string.trimleft(arg,',') ++ '\r\n')
```
markdown格式由
`[引用文字](file:///本地pdf地址#page=x)`
变为
`[引用文字](file:///引导程序地址,本地pdf地址#page=x)`
其中引导程序地址和本地pdf地址之间用`,`连接。
如:
> 节选自应用笔记《[射频与微波技术实用手册](file:///E:\aardio.Prj\bat\mrun.exe,E:\文档\应用笔记\射频与微波技术实用手册.pdf?)》P235
[test][1]
[test2][2]
[test3][3]
[1]:<file:///E:\aardio.Prj\bat\mrun.exe,E:\文\应用笔记\射频与微波技术实用手册.pdf>
[2]:E:\文档\应用笔记\射频与微波技术实用手册.pdf
[3]:file:///E:\aardio.Prj\bat\mrun.exe,
<a href="file:///E:\aardio.Prj\bat\mrun.exe">test0</a>