在测试ocr生成双层pdf文件时 提示尝试写入受保护内存,
如果没有这几句
DocumentWriter docwriter = _ocrDocument.Engine.DocumentWriterInstance;
PdfDocumentOptions pdfOptions = docwriter.GetOptions(DocumentFormat.Pdf) as PdfDocumentOptions;
pdfOptions.DocumentType = PdfDocumentType.Pdf;
pdfOptions.ImageOverText = true;
pdfOptions.PageRestriction = DocumentPageRestriction.Relaxed;
直接 _ocrDocument.Save(strSavePDFPath, DocumentFormat.Pdf, null); 则没问题,
增加这几句时再 _ocrDocument.Save(strSavePDFPath, DocumentFormat.Pdf, null); 就提示问题
|