p:带有PDF文件的媒体会导致“文件不是以'%PDF-'开头". IE7中的错误 [英] p:media with PDF file causes "File does not begin with '%PDF-'." error in IE7

查看:582
本文介绍了p:带有PDF文件的媒体会导致“文件不是以'%PDF-'开头". IE7中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在根据以下问题使用<p:media>:如何使用< p:media>绑定动态内容?

I'm using <p:media> based on this question&answer: How to bind dynamic content using <p:media>?

在IE7中无法正常运行,但Mozilla和Chrome可以正常运行. IE7错误如下:

It doesn't work in IE7 while it works fine Mozilla and Chrome. IE7 errors as:

文件不是以'%PDF-'开头.

File does not begin with '%PDF-'.

我了解这是因为生成的PDF的文件名为dynamiccontent.properties.xhtml.如何更改文件名?我尝试在DefaultStreamedContent构造函数中传递文件名,但是没有效果.

I understood it's because the file name for generated PDF is dynamiccontent.properties.xhtml. How do I change the file name? I tried passing the file name in DefaultStreamedContent constructor, but it had no effect.

推荐答案

很抱歉,您可以死贴,但对于那些正在阅读本文的人来说,是的,这可能是文件名问题.

Sorry to necro-post but for those who are seeing this article, yes it can be a file name issue.

Acrobat产品从历史上就一直打开PDF,只要%PDF-header开始在文件的前1024个字节之内即可. %PDF-header之前没有对多余字节进行检查.但是,10.1.5和11.0.01更新通过强制执行更严格的PDF标头解析来提高安全性.现在,该产品拒绝打开一小部分未正确以'%PDF-'标头开头的PDF.

Acrobat products have historically opened a PDF as long as the %PDF-header started anywhere within the first 1024 bytes of the file. No checks were performed on the extraneous bytes before the %PDF-header. However, the 10.1.5 and 11.0.01 updates improve security by enforcing stricter parsing of the PDF-header. The product now refuses to open the small fraction of PDFs that do not correctly start with the '%PDF-' header.

您可以通过设置适当的首选项来禁用计算机上的标头验证

You can disable the header validation on machines by setting the appropriate preference

如果AVG​​eneral密钥不存在,请手动创建.

If the AVGeneral key does not exist, create it manually.

HKLM路径一般为:

The HKLM path is generically:

HKLM \ Software \ Adob​​e(产品名称)(版本)\ AVGeneral \ bValidateBytesBeforeHeader = dword:00000000

HKLM\Software\Adobe(product name)(version)\AVGeneral\bValidateBytesBeforeHeader=dword:00000000

例如,要更改Acrobat 11.0的行为,请在以下位置创建DWORD:HKLM \ SOFTWARE \ Adob​​e \ Adob​​e Acrobat \ 11.0 \ AVGeneral \ bValidateBytesBeforeHeader = dword:00000000

For example, to change the behavior for Acrobat 11.0, create a DWORD at this location: HKLM\SOFTWARE\Adobe\Adobe Acrobat\11.0\AVGeneral\bValidateBytesBeforeHeader=dword:00000000

HKCU路径一般为:

The HKCU path is generically:

HKCU \ Software \ Adob​​e(产品名称)(版本)\ AVGeneral \ bValidateBytesBeforeHeader = dword:00000000

HKCU\Software\Adobe(product name)(version)\AVGeneral\bValidateBytesBeforeHeader=dword:00000000

例如,要更改Reader 10.0的行为,请在以下位置创建DWORD:HKCU \ SOFTWARE \ Adob​​e \ Acrobat Reader \ 10.0 \ AVGeneral \ bValidateBytesBeforeHeader = dword:00000000

For example, to change the behavior for Reader 10.0, create a DWORD at this location: HKCU\SOFTWARE\Adobe\Acrobat Reader\10.0\AVGeneral\bValidateBytesBeforeHeader=dword:00000000

始终在首选项路径中更改产品和版本号以匹配您的安装.这种方法使PDF可以显示在您控制的机器上.

Always change the product and version number in the preference path to match your installation. This method allows the PDF to display on machines you control.

https://helpx.adobe.com/acrobat/kb/pdf-error-1015-11001-update.html

这篇关于p:带有PDF文件的媒体会导致“文件不是以'%PDF-'开头". IE7中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆