Home
Virtual Image Printer DriverMiraplacid Publisher converts documents to images
Virtual Text Printer DriverMiraplacid Text Driver extracts text from documents
PostScript Printer DriverMiraplacid PostScript Driver prints documents with your content inserted
Miraplacid Binary and Text DOM SDKMiraplacid Binary and Text DOM SDK - access to internal structure of a binary and text files
Common:   Login | Rules of forum | Register
Management:  New topic | Close topic | Move topic | Delete topic
  

Miraplacid Forum >> Binary DOM and Text DOM >> Two forms of files in the same documentModerator:Cerberus

Author Topic:  Two forms of files in the same document
SteveW
Member

Email
posted 2013-07-17 13:44:41 Reply -Delete

There are two forms of the file, one starts with FFFF and is following by a U16 count of items and then those particular item types. If it doesnt start with FFFF, the U16 count is the first item in the file followed by that number of a different type of item.

e.g.

FFFF....

or

....

I've tried a few variations on BDD files to handle this, but not having much luck.

Can you suggest a possible solution?

XMan
Moderator

Web-page
Email
posted 2013-07-17 13:46:31 Reply -Delete

You may use the same technique we used in TIFF format spec:

struct TypeOneItem {
...
}

struct TypeTwoItem {
...
}

struct TypeOneDocument {
uint16 magic;
uint16 counter;
TypeOneItem[counter];
AcceptRule magic==0x2a;
}

struct TypeTwoDocument {
uint16 counter;
TypeTwoItem[counter];
}

[extension="tif,tiff", mime_type="image/tiff"]
document TIFF {
(TypeOneDocument|TypeTwoDocument) doc;
}

Your message:
Name, password:
Go to category:  

Technical Support

Copyright © Miraplacid, 2003 - 2024