初始化

This commit is contained in:
xhm
2023-11-21 23:05:03 +08:00
commit 2455630dad
2252 changed files with 466529 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
using CPF.Mac.CoreFoundation;
using System;
using System.Runtime.InteropServices;
namespace CPF.Mac.CoreGraphics
{
internal static class CGPDFString
{
[DllImport("/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/CoreGraphics")]
private static extern IntPtr CGPDFStringCopyTextString(IntPtr pdfStr);
public static string ToString(IntPtr pdfString)
{
if (pdfString == IntPtr.Zero)
{
return null;
}
using (CFString cFString = new CFString(CGPDFStringCopyTextString(pdfString), owns: true))
{
return cFString.ToString();
}
}
}
}