DWF

Reply
Active Member
slavicam
Posts: 6
Registered: ‎03-03-2010
Message 1 of 12 (1,041 Views)

DWFx parsing and correct transform for visible objects

1041 Views, 11 Replies
03-03-2010 01:31 PM
DWFx parsing and correct transform for visible objects
While parsing DWFx, we are using DWF toolkit example, Read2DDWFxFile.cpp , posted on this forum(using pXAMLFile->process_next_object():smileywink:, and object processing by callback.
The reading and parsing object is perfect, thank you for that example.
The issue we have is that some entities, (text, dimensions, raster, for example), seem to be translated incorrectly, usually by the offset of the lower left hand corner of the current viewport.
Scale is correct for all entities.
We have poly lines that are in the correct location relative to the viewport, directly following the text with no viewport between them, and text seems to be offset with the value calculated based on page paper height (or perhaps text is OK but poly is offset in the opposite direction).
We do not see what we can use from DWF toolkit to read-calculate and correct transform per object, and it looks like a bug to us, in the conversion from XPS/XML to W2D objects where some objects are not transformed through a viewport matrix, or similar situation.
Has anyone else seen something similar and is there a solution?
Gloria
Employee
JeffreyKlug
Posts: 3
Registered: ‎08-18-2009
Message 2 of 12 (1,041 Views)

Re: DWFx parsing and correct transform for visible objects

03-10-2010 02:27 PM in reply to: slavicam
Hi Gloria,

Honestly, I'd be shocked if there was such a fundamental bug found in the toolkit at this stage. But, it's not impossible. :smileyhappy: FWIW, the only 'special treatment' that DWFx gets versus DWF in Autodesk Design Review, for example, is for font handling, which is unrelated to the reported issue.

Is this happening with all DWFx files you encounter, or only a specific drawing?

Thanks.

Jeffrey Klug
Software Architect
Autodesk, Inc.
Employee
SilviaCao
Posts: 136
Registered: ‎06-07-2009
Message 3 of 12 (1,041 Views)

Re: DWFx parsing and correct transform for visible objects

03-10-2010 05:42 PM in reply to: slavicam
Thank you for your question.

Yes, the W2D objects are not transformed through a viewport matrix. They are translated automatically by DWFToolkit when parsing.

Please let me know if you have any further questions.

Silvia


Silvia Cao
SW Engineer
PSEB-GE- ACRD PSEB
Autodesk, Inc.
Active Member
slavicam
Posts: 6
Registered: ‎03-03-2010
Message 4 of 12 (1,041 Views)

Re: DWFx parsing and correct transform for visible objects

03-11-2010 01:50 PM in reply to: slavicam
Thank you Jeffry for confirming that should not be a difference between DWF and DWFx objects, and parsing them through WT_File and WT_XAML_File respectivly.
I do not have many files to test with, but all we have, 4 DWFx files with viewports, they all behave the same; raster and text are presumably with page height offset when we apply transform based on eplot and extents, and poly is correct (or wise versa, raster and text are OK, but poly needs to be offset by page height). When we process DWF files (those, DWF files, we do have many to test with), the same transform code creates correct views in our application.

I apologize for bringing possibility that issue we have might be an error in DWF toolkit.
Sincerely, I’m convinced it is my luck of DWF toolkit expertise, to be able to find the correct transform out of eplot transform, extents, view, and viewports transforms, and correct order of transform operations to apply to different objects.
Thank again for the reply.
Active Member
slavicam
Posts: 6
Registered: ‎03-03-2010
Message 5 of 12 (1,041 Views)

Re: DWFx parsing and correct transform for visible objects

03-11-2010 01:56 PM in reply to: slavicam
Thank you Silvia
I’m new to DWF Toolkit, so I do not know in advance if this clarification will help me to resolve the issue, but I’ll definitely try to resolve my problem, by calling default DWF Toolkit callbacks from our callbacks, which should apply viewport matrix while parsing the objects.
Thank you again for clarification on this subject.
Employee
JeffreyKlug
Posts: 3
Registered: ‎08-18-2009
Message 6 of 12 (1,041 Views)

Re: DWFx parsing and correct transform for visible objects

03-11-2010 08:10 PM in reply to: slavicam
Let us know if this fixes it for you. Thanks for the responses!

Jeffrey Klug
Member
anndunbar
Posts: 5
Registered: ‎04-03-2006
Message 7 of 12 (1,041 Views)

Re: DWFx parsing and correct transform for visible objects

06-01-2010 01:34 PM in reply to: slavicam
Where can I find the file, Read2DDWFxFile.cpp, mentioned in this post - I didn't find it in the download of the 7.6 version of the toolkit.
Active Member
slavicam
Posts: 6
Registered: ‎03-03-2010
Message 8 of 12 (1,041 Views)

Re: DWFx parsing and correct transform for visible objects

06-01-2010 01:53 PM in reply to: slavicam
Read2DDWFxFile.cpp is posted by SilviCao from Autodesk Thread: Adding text to a DWF:
https://discussion.autodesk.com/forums/message.jspa?messageID=6315652
Contributor
janderssen
Posts: 19
Registered: ‎11-25-2008
Message 9 of 12 (1,041 Views)

Re: DWFx parsing and correct transform for visible objects

06-01-2010 08:24 PM in reply to: slavicam
I had this exact issue.

I had to make sure that the definePageLayout parameters were 100% correct, and all worked fine.
I still have not resolved where to get the scale factor, much appreciated if someone from autodesk could answer this, would be very appreciated.

My Code :

WT_Matrix2D oTransform;
oTransform(0,0) = pGraphicResource->transform()[0];
oTransform(1,1) = pGraphicResource->transform()[5];
oTransform(2,0) = pGraphicResource->transform()[12];
oTransform(2,1) = pGraphicResource->transform()[13];
DWFEPlotSection *pPlotSection = dynamic_cast( m_pSection );

// scale factor i do not know where to get it from, so for now I set it to 1
pxFile->definePageLayout( oTransform, pPlotSection->paper()->width(), pPlotSection->paper()->height(), 1 /*scale factor (see note)*/);


Cheers
Jason Anderssen
Active Member
1810msa
Posts: 6
Registered: ‎03-08-2011
Message 10 of 12 (543 Views)

Re: DWFx parsing and correct transform for visible objects

03-08-2011 02:01 AM in reply to: slavicam

The following post link is invalid for Dwfx example, could you please make sure of it?

https://discussion.autodesk.com/forums/message.jspa?messageID=6315652

 

 

Regards,

Hmeidi

Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.