Hello,
I’m migrating annotation to 3.1.0 from 2.x(dont remember exact version right now). But i found an issue that cause error. If i give absolute document path(ex: C:\test\abc.docx) annotation gives an error on “annotator.GetDocumentInfo(request.Path)” method. Error says "Cannot create “C:\test\abc.docx”
because a file or directory with the same name already exists."
But if i move document to App_Data folder and give filename(abc.docx) instead of absolute path, it works.
Also i’m implemented groupdocs viewer 3.6.0 in our project. I checked it too, i’m using same pattern in viewer to “_imageHandler.GetDocumentInfo(request.Path)” method. But when i’m using it, in that method absolute path changes and it replaces special characters then write it to temp folder.
I assume that if “annotator.GetDocumentInfo(request.Path)” method also replaces special characters as imagehandler or htmlhandler. This wont be a problem.
Also i’m checked your sample too, usage of GetDocumentInfo method is same but in your sample you’re using filename instead of absolute path.
Could you check this issue?
Hi,
string repositoryFolder = “C:/Test/”; AppDomain.CurrentDomain.GetData(“DataDirectory”) + “/”;
Hello,
I understand your point.
But i dont understand this;
If i gave absolute path to Groupdocs.Viewer, its works without any problem. But it doesnt work on Groupdocs.Annotation. I understand that they are different but in the end their base and first purpose is viewing documents.
When i gave absolute path to Groupdocs.Viewer it replaces special characters to _, after that viewer concatenate storagePath and changed absolute path. And its works like a charm. Why they are not work same way.
I’m insisting it because, in our project source path can be different for documents. And we dont want to move documents every time.
Isn’t it possible Groupdocs.Viewer and Groupdocs.Annotation(Viewer part) works same?
Hi,
Hello,
I want to manage input and output. I checked your sample project. I found DocumentInfoRepository.cs and FileRepository classes to manage input/output in your sample project. I implemented them in my project. Also added them to unity config like below;
var annotator = new AnnotationImageHandler(By the way, i created a dll to manage annotation datas. We want to store them in sql/oracle db.
new AnnotationConfig { StoragePath = repositoryFolder, TempPath = tempPath },
new Data.Repositories.UserRepository(),
new Data.Repositories.AnnotationDocumentRepository(),
new Data.Repositories.AnnotationRepository(),
new Data.Repositories.AnnotationReplyRepository(),
new Data.Repositories.AnnotationCollaboratorRepository(),
new Data.Repositories.FileRepository(repositoryFolder),
new Data.Repositories.DocumentInfoRepository(repositoryFolder));
But in your sample FileRepository and DocumentInfoRepository class contains NotImplemented methods. And a couple method doesn’t contain in interfaces.
My question is how should i implemented those methods. Because some of them are called from AnnotationImageHandler.GetDocumentInfo() method. When i debug FileRepository and DocumentInfoRepository i get following results;
AnnotationImageHandler.GetDocumentInfo() method’s first call is FileRepository.GetFileDescription(string guid) method. This method was notimplemented(I’m talking throw new NotImplementedException() kind not implemented). I create new FileDescription instance and everything is fine. BTW guid variable was my absolute path(as i wanted)
Then it calls DocumentInfoMethod.GetFileData(FileDescription fileDescription) method. This was notimplemented too. This method returns FileData object, and i create a new instance of FileData class and return it as default. But i guess this object must be filled and this object has contains properties like pages, pageCount, maxHeight, maxWidth. For filling them i have to process document. Is this mandatory? Or could you give me a sample of usage this method, if you have. Also do i need to do anything beside filling FileData instance?
Then it calls FileRepository.GetFile(string guid) method. In this method guid variable is “Temp//abc.pdf”. It should be in my repositoryFolder, i guess i have to create it by myself? Or is there a helper class/method to create it? Or where should i create it(i mean which class-method)?
Because of abc.docx not exist i cant go further.
One last think do you have any fully implemented sample about this subject?
Kind regards,