0

好的,我熟悉整个概念,并且我已经设法为NSImage.

这就是我的做法:

- (void)maskOne:(NSString*)filename atTarget:(NSString*)folder
{
    NSString* target = [self getTargetPathForFile:filename path:folder];

    NSImage* newImage;

    NSImage* oldImage = [[NSImage alloc] initWithContentsOfFile:filename];

    newImage = [self maskImage:oldImage withMask:[self imageWithSubviews]];

    [self saveImage:newImage asPNG:target]; 
}

where从嵌入的黑色背景框中[self imageWithSubviews]返回一个,其中包含一些透明文本。NSImage


现在,在我的一个更大的应用程序中,作为一个子项目,我试图通过应用水印来“保护”导出的 PDF(没什么复杂的,只是每页中间的一段简单的文本或其他东西)。

你会怎么做?

4

1 回答 1

1

您可以使用 CoreGraphics 框架来修改 PDF 内容 - 请阅读Apple关于该主题的官方文档。

于 2012-10-12T17:46:06.047 回答