因此,我试图创建一个控制台应用程序,它将监视一个目录,当一个文件夹被放到目录中时,它将优化文件夹中的文件。优化部分正在工作。目前,我担心的是,一旦我使用FileSystemWatcher运行程序,它就永远不会承认更改。类是否只专注于根目录而不是更深的位置?
我还在微软的网站上看到,查看已被复制、粘贴或移动到目录中的文件的方法是使用FileSystemWatcher.Renamed而不是.Changed,这正是我之前遇到的问题。
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.IO
以下代码会导致System.InvalidOperationException,因为存在问题的文件仍在使用中。PDFTron文档中没有关于如何关闭文件的明确指导,但以下是例外情况:
// in my dispose method. _pdfViewWpf is a pdftron.PDF.PDFViewWPF, and _pdfPath is the filepath I set the doc to.
_pdfViewWpf.CloseDoc();
_pdfViewWpf.Dispose();
File.Move(_pdfPath, @"C:\myFilePath\Test.pd
我对pdftron有一个问题,在pdftron中打开某个文件将导致我们的应用程序崩溃,导致以下错误:
An unhandled exception of type 'pdftron.Common.PDFNetException' occurred in PDFNet.dll
Additional information: Exception:
Message: Missing resource
Conditional expression: res
Filename : ContentResources.hpp
Function : trn::PDF
PDFTron似乎不能处理多个AppDomain。当从单独的PDFTron运行AppDomain时,应用程序会以未处理的异常崩溃(“无法跨AppDomains传递GCHandle”)。
bei System.Runtime.InteropServices.GCHandle.InternalCheckDomain(IntPtr handle)
bei System.Runtime.InteropServices.GCHandle.FromIntPtr(IntPtr value)
bei gcroot<pdftron::PDF::PDFViewWPF ^>.->
在Rails模型中,是否可以说只有在创建新记录时才能访问该属性,而在更新时不能访问该属性?
类似于:
class DesiredModel < ActiveRecord::Base
attr_accessible :type, :only => [:create] # this is just example
attr_accessible :type if :new_record? # this is just example
end
执行以下代码
import org.junit.Test;
import pdftron.PDF.Convert.XODOutputOptions;
public class TestPDFTron {
@Test
public void test() {
new XODOutputOptions();
}
}
它抛出以下异常
java.lang.UnsatisfiedLinkError: pdftron.SDF.ObjSet.Create()J
at pdftron.SDF.ObjSet.Create(Native Method)
at pdftron.SDF.ObjSet.