Browse Source

【2025】【PDFView】导出格式不对问题

dinglingui 1 month ago
parent
commit
7129b3ea88

+ 4 - 4
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListView.m

@@ -873,18 +873,18 @@ void CPDFListViewOCDrawLineHandles(CGContextRef context, CGRect rect, CGFloat ra
         NSData *data = [image TIFFRepresentation];
         NSBitmapImageRep *imageRep = [NSBitmapImageRep imageRepWithData:data];
         [imageRep setSize:[image size]];
-        NSBitmapImageFileType type = NSBitmapImageFileTypePNG;
+        NSBitmapImageFileType imageType = NSBitmapImageFileTypePNG;
         NSString *typeStr = @"png";
         if (type == 0) {
-            type = NSBitmapImageFileTypePNG;
+            imageType = NSBitmapImageFileTypePNG;
             typeStr = @"png";
         } else if (type == 1) {
-            type = NSBitmapImageFileTypeJPEG;
+            imageType = NSBitmapImageFileTypeJPEG;
             typeStr = @"jpg";
         } else if (type == 2) {
             [self exportPDF:image];
         }
-        NSData *imageData = [imageRep representationUsingType:NSBitmapImageFileTypeJPEG properties:@{}];
+        NSData *imageData = [imageRep representationUsingType:imageType properties:@{}];
         
         NSSavePanel *savePanel = [NSSavePanel savePanel];
         savePanel.allowedFileTypes = @[typeStr];

+ 1 - 1
PDF Office/PDF Master/KMClass/KMPDFViewController/KMPDFMenuConfig.swift

@@ -909,7 +909,7 @@ let BOTAMenuIdentifier_Annotation_DeleteMuteRep = "BOTAMenuIdentifier_Annotation
         let subItem1Property: ComponentMenuitemProperty = ComponentMenuitemProperty(text: KMLocalizedString("PNG"),identifier: PDFViewMenuIdentifier_Normal_ExportPNG,
                                                                                     representedObject: listView)
         let subItem2Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
-                                                                                    text: KMLocalizedString("PDF"),identifier: PDFViewMenuIdentifier_Normal_ExportPNG,
+                                                                                    text: KMLocalizedString("PDF"),identifier: PDFViewMenuIdentifier_Normal_ExportPDF,
                                                                                     representedObject: listView)
         subMenuItemArr.append(subItem0Property)
         subMenuItemArr.append(subItem1Property)