ComPDFKit PDF SDK V1.6.0 Updated New Features: Edit PDF Directly like Word!

2022-12-02 11:47:42 浏览数 (1)

支持的平台:

- iOS

- Android

- Windows

新功能:编辑PDF

- 编辑文字: 通过代码的方式添加、删除、修改原PDF文档中的文字。支持设置字体大小、位置、对齐方式等

- 编辑图片: 通过代码的方式添加、删除、替换原PDF文档中的图片。支持裁剪、旋转、移动图片等功能

您可以像在 Microsoft Word 中一样使用鼠标和键盘来操作文本或图像区域  ,如果您想复制、粘贴、剪切或删除文本或图像,您可以使用 的 事件。以下代码将向您展示如何执行此操作。CPDFViewerCPDFViewerPDFEditCommandHandler

代码语言:javascript复制
viewer.PDFEditCommandHandler  = Viewer_PDFEditCommandHandler;
private void Viewer_PDFEditCommandHandler(object sender, TextEditCommand e)
{
    e.Handle = true;
    e.PopupMenu = new ContextMenu();
    e.PopupMenu.Items.Add(new MenuItem() { Header = "Copy", Command = ApplicationCommands.Copy, CommandTarget = (UIElement)sender });
    e.PopupMenu.Items.Add(new MenuItem() { Header = "Cut", Command = ApplicationCommands.Cut, CommandTarget = (UIElement)sender });
    e.PopupMenu.Items.Add(new MenuItem() { Header = "Paste", Command = ApplicationCommands.Paste, CommandTarget = (UIElement)sender });
    e.PopupMenu.Items.Add(new MenuItem() { Header = "Delete", Command = ApplicationCommands.Delete, CommandTarget = (UIElement)sender });
    e.PopupMenu.Items.Add(new MenuItem() { Header = "Select All", Command = ApplicationCommands.SelectAll, CommandTarget = (UIElement)sender });
}

0 人点赞