Fix #421 #465 #505 #665 #672 #705 #805: show annotations in PDF

This commit is contained in:
Paddy Xu
2021-01-10 12:13:48 +01:00
parent 6af2a5ec0d
commit 9c384be49c
3 changed files with 13 additions and 14 deletions

View File

@@ -61,9 +61,9 @@ namespace QuickLook.Plugin.PDFViewer
var realWidth = (int) Math.Round(size.Width * scale.Horizontal * factor); var realWidth = (int) Math.Round(size.Width * scale.Horizontal * factor);
var realHeight = (int) Math.Round(size.Height * scale.Vertical * factor); var realHeight = (int) Math.Round(size.Height * scale.Vertical * factor);
bitmap = doc.PdfDocument.Render(page, realWidth, realHeight, dpiX, dpiY, bitmap = doc.PdfDocument.Render(page, realWidth, realHeight, dpiX, dpiY, PdfRotation.Rotate0,
PdfRenderFlags.LimitImageCacheSize | PdfRenderFlags.LcdText | PdfRenderFlags.Annotations | PdfRenderFlags.LimitImageCacheSize | PdfRenderFlags.LcdText | PdfRenderFlags.Annotations |
PdfRenderFlags.ForPrinting) as Bitmap; PdfRenderFlags.ForPrinting, true) as Bitmap;
} }
var bs = bitmap?.ToBitmapSource(); var bs = bitmap?.ToBitmapSource();

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\PdfiumViewer.Native.x86.v8-xfa.2018.4.8.256\build\PdfiumViewer.Native.x86.v8-xfa.props" Condition="Exists('..\..\packages\PdfiumViewer.Native.x86.v8-xfa.2018.4.8.256\build\PdfiumViewer.Native.x86.v8-xfa.props')" /> <Import Project="..\..\packages\PDFium.x64.v8-xfa.4194.0.0\build\pdfium.x64.v8-xfa.props" Condition="Exists('..\..\packages\PDFium.x64.v8-xfa.4194.0.0\build\pdfium.x64.v8-xfa.props')" />
<Import Project="..\..\packages\PdfiumViewer.Native.x86_64.v8-xfa.2018.4.8.256\build\PdfiumViewer.Native.x86_64.v8-xfa.props" Condition="Exists('..\..\packages\PdfiumViewer.Native.x86_64.v8-xfa.2018.4.8.256\build\PdfiumViewer.Native.x86_64.v8-xfa.props')" /> <Import Project="..\..\packages\PDFium.x86.v8-xfa.4194.0.0\build\pdfium.x86.v8-xfa.props" Condition="Exists('..\..\packages\PDFium.x86.v8-xfa.4194.0.0\build\pdfium.x86.v8-xfa.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -65,8 +65,8 @@
</AssemblyOriginatorKeyFile> </AssemblyOriginatorKeyFile>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="PdfiumViewer, Version=2.13.0.0, Culture=neutral, PublicKeyToken=91e4789cfb0609e0, processorArchitecture=MSIL"> <Reference Include="PdfiumViewer, Version=2.14.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\PdfiumViewer.2.13.0.0\lib\net20\PdfiumViewer.dll</HintPath> <HintPath>..\..\packages\PdfiumViewer.Updated.2.14.0\lib\net45\PdfiumViewer.dll</HintPath>
</Reference> </Reference>
<Reference Include="PresentationCore" /> <Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" /> <Reference Include="PresentationFramework" />
@@ -114,17 +114,17 @@
</Page> </Page>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="packages.config" /> <Resource Include="Resources\loading.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="Resources\loading.png" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup> </PropertyGroup>
<Error Condition="!Exists('..\..\packages\PdfiumViewer.Native.x86_64.v8-xfa.2018.4.8.256\build\PdfiumViewer.Native.x86_64.v8-xfa.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\PdfiumViewer.Native.x86_64.v8-xfa.2018.4.8.256\build\PdfiumViewer.Native.x86_64.v8-xfa.props'))" /> <Error Condition="!Exists('..\..\packages\PDFium.x86.v8-xfa.4194.0.0\build\pdfium.x86.v8-xfa.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\PDFium.x86.v8-xfa.4194.0.0\build\pdfium.x86.v8-xfa.props'))" />
<Error Condition="!Exists('..\..\packages\PdfiumViewer.Native.x86.v8-xfa.2018.4.8.256\build\PdfiumViewer.Native.x86.v8-xfa.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\PdfiumViewer.Native.x86.v8-xfa.2018.4.8.256\build\PdfiumViewer.Native.x86.v8-xfa.props'))" /> <Error Condition="!Exists('..\..\packages\PDFium.x64.v8-xfa.4194.0.0\build\pdfium.x64.v8-xfa.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\PDFium.x64.v8-xfa.4194.0.0\build\pdfium.x64.v8-xfa.props'))" />
</Target> </Target>
</Project> </Project>

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="PdfiumViewer" version="2.13.0.0" targetFramework="net462" /> <package id="PDFium.x64.v8-xfa" version="4194.0.0" targetFramework="net462" />
<package id="PdfiumViewer.Native.x86.v8-xfa" version="2018.4.8.256" targetFramework="net462" /> <package id="PDFium.x86.v8-xfa" version="4194.0.0" targetFramework="net462" />
<package id="PdfiumViewer.Native.x86_64.v8-xfa" version="2018.4.8.256" targetFramework="net462" /> <package id="PdfiumViewer.Updated" version="2.14.0" targetFramework="net462" />
</packages> </packages>