Community
DWF
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to read drawable objects from 2D DWF file?

3 REPLIES 3
Reply
Message 1 of 4
geotavros
1354 Views, 3 Replies

How to read drawable objects from 2D DWF file?

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:

Spoiler

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

Tags (2)
3 REPLIES 3
Message 2 of 4
geotavros
in reply to: geotavros

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);

 

 

Message 3 of 4
edporras
in reply to: geotavros

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.

 

Message 4 of 4
geotavros
in reply to: edporras

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

”Boost

 

”Tips

 

”Services