I am using an old version of docuvieware and about to upgrade to lastest version for dxf file support in the project.
But unfortunately I can't find the way to contorl the annotations in dxf file.
In my case, I need to use AnnotationManager to get full control of the annotations. The manager initials like:
But in dxf files, these two ways can't initialize the manager, and returns "UnsupportedImageFormat" status.
Also tried the InitFromStream function but it results the same.
So if there's something I missed ?
How can I use annotation manager in dxf files?
You have at least 2 options:
Use the GetAnnotationManager() method of the DocuVieware class.
Use this approach (tested with latest version).
Code: Select all
FileStream fileStream = File.OpenRead("d:\\test.dxf"); AnnotationManager annotationManager = new AnnotationManager(); GdPictureStatus status = annotationManager.InitFromStream(fileStream);
With best regards,
I still have some questions.
1: I have checked the DocuVieware class in document but can't find the "GetAnnotationManager" method. If your api have this method, it could be very helpful.
2: I found that if I just call the "InitFromStream" method, it works fine. But please check the attached pics.
First I load the document, then initFromStream failed.
So I change another way, initFromStream first, but load document failed...
My apologies, I made the confusion with an internal method of the toolkit. Y can deal with these two method to import / export annotations:
public GdPictureStatus SaveAnnotations(Stream Annotations, bool AllPages)
public GdPictureStatus LoadAnnotations(Stream Annotations)
You are calling the LoadFromStream by setting true to the ownStream parameter. Subsequently to this call, the stream is disposed. So you can not access it anymore.
Unfortunately I can't use SaveAnnotations and LoadAnnotations method because we use xml format data and save in database instead of file itself.
Actually I use AnnotationManager.AddAnnotationFromXML and AnnotationManager.GetAnnotationXML method to save and load annotations.
And since you had :
and Docuvieware.GetNativeImage, AnnotationManager.InitFromGdPictureImage
method, I wonder if there methods like "GetNativeDXF", "InitFromGdPictureDXF" or something ?
About the LoadFromStream method, I also tried to set the 'ownStream' to false, it works for pdf and images, but failed in dxf files. Please check the files attached.
- TIM截图20180816172011.png (11.69 KiB) Viewed 791 times
- TIM截图20180816171947.png (10.96 KiB) Viewed 791 times
I am not sure to understand. The mentioned methods are saving the annotation flow within standalone xml structure. This seems to be exactly what you are looking for. Have you tried the use them?Unfortunately I can't use SaveAnnotations and LoadAnnotations method because we use xml format data and save in database instead of file itself.
If the problem persists please try to provide a standalone code snippet that we can run "as is." I can not work on screenshot
Please also ensure yourself to use the latest available version.
Thank you for your efforts.
Who is online
Users browsing this forum: No registered users and 1 guest