How can I use Annotation Manager with dxf files?
How can I use Annotation Manager with dxf files?
Hi
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:
dvwDocument.GetNativePDF(out gdPicturePDF);
manager.InitFromGdPicturePDF(gdPicturePDF);
or
dvwDocument.GetNativeImage(out imageID);
manager.InitFromGdPictureImage(imageID);
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?
Thanks.
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:
dvwDocument.GetNativePDF(out gdPicturePDF);
manager.InitFromGdPicturePDF(gdPicturePDF);
or
dvwDocument.GetNativeImage(out imageID);
manager.InitFromGdPictureImage(imageID);
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?
Thanks.
Re: How can I use Annotation Manager with dxf files?
Hi,
You have at least 2 options:
1:
Use the GetAnnotationManager() method of the DocuVieware class.
2:
Use this approach (tested with latest version).
Please let me know if you need further information.
With best regards,
Loïc
You have at least 2 options:
1:
Use the GetAnnotationManager() method of the DocuVieware class.
2:
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,
Loïc
Re: How can I use Annotation Manager with dxf files?
Hi Loïc
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...
Thanks.
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...
Thanks.
Re: How can I use Annotation Manager with dxf files?
Hi Garfield,
For 1:
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)
For 2:
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.
Kind regards,
Loïc
For 1:
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)
For 2:
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.
Kind regards,
Loïc
Re: How can I use Annotation Manager with dxf files?
Hi Loïc
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 :
Docuvieware.GetNativePDF, AnnotationManager.InitFromGdPicturePDF
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.
Thanks.
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 :
Docuvieware.GetNativePDF, AnnotationManager.InitFromGdPicturePDF
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.
Thanks.
- Attachments
-
- TIM截图20180816172011.png (11.69 KiB) Viewed 6254 times
-
- TIM截图20180816171947.png (10.96 KiB) Viewed 6254 times
Re: How can I use Annotation Manager with dxf files?
Hi,
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.
Kind regards,
Loïc
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.
Kind regards,
Loïc
Who is online
Users browsing this forum: No registered users and 1 guest