mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-12-25 02:00:12 +08:00
restore determining PDF fiels via file content for previewing .ai files.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.ExceptionServices;
|
||||
using System.Text;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace QuickLook.Plugin.PDFViewer
|
||||
@@ -43,11 +44,10 @@ namespace QuickLook.Plugin.PDFViewer
|
||||
if (File.Exists(path) && Path.GetExtension(path).ToLower() == ".pdf")
|
||||
return true;
|
||||
|
||||
//using (var br = new BinaryReader(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)))
|
||||
//{
|
||||
// return Encoding.ASCII.GetString(br.ReadBytes(4)) == "%PDF";
|
||||
//}
|
||||
return false;
|
||||
using (var br = new BinaryReader(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read)))
|
||||
{
|
||||
return Encoding.ASCII.GetString(br.ReadBytes(4)) == "%PDF";
|
||||
}
|
||||
}
|
||||
|
||||
public void Prepare(string path, ContextObject context)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
mc:Ignorable="d" x:Class="QuickLook.MainWindowTransparent" x:Name="mainWindow"
|
||||
UseLayoutRounding="True"
|
||||
d:DesignWidth="624" d:DesignHeight="700"
|
||||
MinWidth="275" MinHeight="150"
|
||||
MinWidth="400" MinHeight="200"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Focusable="False" WindowStyle="None"
|
||||
AllowsTransparency="True"
|
||||
|
||||
Reference in New Issue
Block a user