• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    DWF

    Reply
    Contributor
    Posts: 12
    Registered: ‎03-27-2012

    How to read drawable objects from 2D DWF file?

    845 Views, 3 Replies
    04-24-2012 08:19 AM

    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

    Please use plain text.
    Contributor
    Posts: 12
    Registered: ‎03-27-2012

    Workaround

    04-25-2012 07:05 AM 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);

     

     

    Please use plain text.
    New Member
    Posts: 2
    Registered: ‎09-19-2012

    Re: How to read drawable objects from 2D DWF file?

    09-19-2012 03:31 PM 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.

     

    Please use plain text.
    Contributor
    Posts: 12
    Registered: ‎03-27-2012

    Re: How to read drawable objects from 2D DWF file?

    09-21-2012 02:19 AM 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

    Please use plain text.