DWF
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
How to read drawable objects from 2D DWF file?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I've used this sample code to read a 2D DWF file. I want to get Lines, Polylines, Text and other drawable objects from the DWF file but all I get is this list of object's types:
DWF_Header_ID
Creator_ID
Creation_Time_ID
Modification_Time_ID
Source_Filename_ID
Source_Creation_Time_ID
Source_Modification_Time_ID
Units_ID
Title_ID
Embed_ID
Named_View_ID
Named_View_ID
View_ID
Plot_Info_ID
Optimized_For_Plot_ID
Color_ID
Layer_ID
Font_Extension_ID
Font_ID
How can I get those drawable entities?
I'm using OS X Lion and XCode 4.3.2.
I've attached my source code and DWF file
For reading DWFx files I used this code and it works. It reads polyline and text objects.
Edited by
Discussion_Admin
Workaround
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I've found the problem. while loop breaks because of
WT_Result::Unsupported_DWF_Opcode is returned from
process_next_object(). This example code doesn't break the loop on this error, and continues until some other error happens:
do {
r = inputStream.process_next_object();
const WT_Object* obj = inputStream.current_object();
if (obj)
printObjectType(obj->object_id());
// we can serialize the obj to another file
cout << r << endl;
} while (r == WT_Result::Success || r == WT_Result::Unsupported_DWF_Opcode);
Re: How to read drawable objects from 2D DWF file?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
I'm working on a small project trying to do the same and was wondering if you could point me to the example you used. I didn't see any files attached to the message?
Hoping you can help. Thanks.
Re: How to read drawable objects from 2D DWF file?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I don't know where is it gone. Or if the link was removed. There is an example of 2D reading on this forum, find it. it is very helpful
