|
@@ -82,6 +82,8 @@ static CGFloat KMPDFBookletGenerate_PDFViewMAXWidth = 290.0;
|
|
|
static CGFloat KMPDFBookletGenerate_PDFViewMAXHeight = 404.0;
|
|
|
|
|
|
//打印时PDFDocument的暂存路径
|
|
|
+#define kPrintFolderPath [[NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:[NSBundle mainBundle].bundleIdentifier]
|
|
|
+
|
|
|
#define kBookletPrintFolderPath [[[NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:[NSBundle mainBundle].bundleIdentifier] stringByAppendingPathComponent:@"Booklet"]
|
|
|
|
|
|
#define kBookletFileSavePath [[[NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:[NSBundle mainBundle].bundleIdentifier] stringByAppendingPathComponent:@"SaveBooklet.pdf"]
|
|
@@ -608,6 +610,12 @@ static CGFloat KMPDFBookletGenerate_PDFViewMAXHeight = 404.0;
|
|
|
if (self = [super initWithWindowNibName:@"KMPDFBookletWindowController"]) {
|
|
|
[self showWaitting];
|
|
|
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
|
|
+ if (![[NSFileManager defaultManager] fileExistsAtPath:kPrintFolderPath]) {
|
|
|
+ if (![[NSFileManager defaultManager] createDirectoryAtPath:kPrintFolderPath withIntermediateDirectories:NO attributes:nil error:nil]) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
[pdfDocument writeToURL:[NSURL fileURLWithPath:kBookletFileSavePath]];
|
|
|
self.pdfDocument = [[PDFDocument alloc] initWithURL:[NSURL fileURLWithPath:kBookletFileSavePath]];
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|