问题描述
我遇到了 PDF 验证问题,我有一个包含 javascript 代码的 pdf
%PDF-1.0
1 0 obj
<<
/Type /Catalog
/Pages 2 0 R
/Names 6 0 R
>>
endobj
2 0 obj
<<
/Type /Pages
/Count 1
/Kids [3 0 R]
>>
endobj
3 0 obj
<<
/Type /Page
/Parent 2 0 R
/Resources << /Font << /F1 5 0 R >>
>>
/MediaBox [0 0 612 792]
/Contents 4 0 R
>>
endobj
4 0 obj
<< /Length 45 >>
stream
BT
/F1 24 Tf
250 700 Td (Hello,World!) Tj
ET
endstream
endobj
5 0 obj
<<
/Type /Font
/Subtype /Type1
/BaseFont /Helvetica
>>
endobj
6 0 obj
<<
/JavaScript 7 0 R
>>
endobj
7 0 obj
<<
/Names [(My Code) 8 0 R]
>>
endobj
8 0 obj
<<
/JS (app.alert({cMsg: document.location,cTitle: "Mario's Message"});
)
/S /JavaScript
>>
endobj
xref
0 9
trailer
<<
/Size 9
/Root 1 0 R
>>
startxref
%%EOF
如何限制上传此类 PDF 文件?
我在前端使用 reactJS,后端使用 java,并使用 PDFTron web SDK 在浏览器上加载 PDF。
我可以在前端通过检查文件的内容来限制这个吗?我可以在后端检查PDF文件的内容吗?
限制带有恶意内容的 PDF 文件的最佳方法是什么?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)