mirror of
https://gitee.com/csharpui/CPF.git
synced 2025-09-19 10:08:26 +08:00
初始化
This commit is contained in:
24
CPF.Mac/Mac/CoreGraphics/CGPDFString.cs
Normal file
24
CPF.Mac/Mac/CoreGraphics/CGPDFString.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user