I'm new to the DWF Toolkit, so I was taking a look through the sample projects, and lo and behold, the "Aggregate" sample project was EXACTLY what I was trying to do (I'm trying to automate merging of all DWFs in a subdirectory). I've found that the aggregate sample project works with most DWFs, but whenever I try to merge multiple files with paper spaces and model spaces, it breaks, sending a DWFXMLDuplicateAttributeException.
My question is, is it possible to merge multiple DWFs that have both paper and model spaces? All I need is the paper space. If it's possible, how would I go about doing it? My thanks to everyone who takes the time to respond to this message.
An update: I've found that by deleting the model view from the DWF files, it merges the PAPER view into the output DWF just fine. Now I need to figure out how to either skip handling the model view, or create a temporary copy of the DWF and delete the model view from it before processing the file.
I also tried getting it to skip the first view (model view) in each file, to no avail, and similarly with the second view (just for testing's sake).
I figured I should include a code snippet from the Aggregate program. It errors out after attempting to execute " pSection->readDescriptor(); ".
DWFManifest:ectionIterator* piSections = rManifestIn.getSections();
DWFSection* pSection = NULL;
for (; piSections->valid(); piSections->next())
pSection = piSections->get();
pSection->readDescriptor(); //<-----THIS IS WHERE IT BREAKS
// Add the section
oWriter.addSection( pSection );
DWFCORE_FREE_OBJECT( piSections );
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register