Skip to content

Latest commit

 

History

History
187 lines (151 loc) · 5.73 KB

MF3200.md

File metadata and controls

187 lines (151 loc) · 5.73 KB

CANON CARPS (Canon Advanced Raster Printing System) print format

(reverse-engineered from LaserBase MF3200)

Data blocks

Data is organized into blocks, each with 20-byte header: 0: 0xCD - magic value 1: 0xCA - magic value 2: 0x10 - magic value 3: data type (0x00 = control data, 0x02 = print data) 4: 0x00 5: block type (0x6b, 0x13, 0x14, 0x16, 0x17, 0x18, 0x19, 0x1a) 6: 0x00 7: 0x01 8: length (high byte) of data following the header (number of bytes) 9: length (low byte) 10-19: padding (zeros)

maximum block size is 65536 B

DOCUMENT structure

0x6b: document name: \x00\x04\ + magic bytes \x00\xf0\x00\x01\x01\x00\x04\x00 + ( character count + 3) + \x00\x11 + character count + name

username: \x00\x06 + magic bytes \x00\x07 + \x00\x11 + character count + user

time: \x00\x09 + magic bytes (\x00\x08) + \x7D\xE1\x43\x00\x0C\x12\x46\xEC (UTC)

\x7D\xE1\x43\x00\x0C\x12\x46\xEC
  ^^  ^ 2014
       ^ JANUARY
          ^^ DAY (5bit) + DAY OF WEEK (3bit)
             ^^ SEPARATOR
                 ^^ HOUR
                     ^^ MINUTES
                          ^^  ^^ SECONDS (6bit) + MILLISECONDS (2+8bit) (?)

0x14: ???: 4 zero bytes

0x17: ???: 4 zero bytes

0x18: ???: 5 bytes: \x00\x2e\x82\x00\x00

0x18: image refinement: 3 bytes: \x08\x2d + \x01 (off) or \x02 (on)

0x18: toner save: 3 bytes: \x08\x5a + \x01 (off) or \x02 (on), if this block needs all

PRINT DATA

0x1a: end of page: 1 byte: \x01

PRINT DATA structure:

all print data is in blocks with data type 0x02, block type 0x1a each page begins with a header (first page has header in separate block, others don't (?)), such as: \x01\x1b%@\x1bP42;600;1J;ImgColor\x1b\\\x1b[11h\x1b[?7;600 I\x1b[20't\x1b[14;;;;;;p\x1b[?2h\x1b[1v\x1b[600;1;0;256;;0;0'c

\x01.%@.P42;600;1J;ImgColor.\.[11h.[?7;600 I.[20't.[14;;;;;;p.[?2h.[1v.[600;1;0;32;;64;0'c

P42: ??? 600: 600dpi (300 = 300dpi) 1J: ??? ImgColor: ???

PaperWeight

  • 20't = Plain paper
  • 15't = Plain Lc
  • 20't = Plain
  • 30't = Heavy
  • 35't = Heavy H
  • 40't = Transparencies
  • 50't = for ENV_C5, ENV_COM10
  • 55't = for ENV_DL ENV_MONAR

Paper size

  • 14 = A4
  • 16 = A5
  • 26 = B5
  • 30 = letter
  • 32 = legal
  • 40 = executive
  • 60 = env. monarch
  • 62 = env. com10
  • 64 = env. DL
  • 66 = env. C5
  • 80 = CUSTOM
    • 3x5" @ 300dpi = ESC[80;1500;900;60;60;60;60p
    • 8.5x14" @ 300dpi = ESC[80;4200;2550;60;60;60;60p
    • 3x5" @ 600dpi = ESC[80;3000;1800;120;120;120;120p
    • ??? @ 600dpi = ESC[80;4960;7014;122;122;128;122p

1v: 1 copy (2v = 2 copies, 99v = 99 copies)

then page data follows in STRIPs, each STRIP in one or more blocks each STRIP includes a header, such as: \x01\x1b[;4720;6768;16.P 4720: strip witdh (in dots) 6768: strip height (in dots) 16: ???

then COMPRESSED DATA HEADER follows (13 bytes): 0: 0x01 - magic value 1: 0x02 - magic value 2: 0x04 - magic value 3: 0x08 - magic value 4-5: 0x0000 6: 0x50 - magic value 7: 0x00 8: last strip indication (0x00 = last, 0x01 = not last) 9-10: length (little endian??) - number of following data bytes (excluding ending 0x80 byte), can span multiple blocks, subsequent blocks do not have this header 11-12: 0x0000

then COMPRESSED DATA follows

strip can span multiple blocks (next blocks are without any headers) strip ends with 0x80 byte

line ends with zero byte (1111 1101) compression is per line (repeat stream can't pass line end)

each page ends with a 2-byte block containing \x01\x0c

print data ends with a 7-byte block containing \x01\x1b\x50\x30\x4a\x1b\x5c

DPI

format inch mm px@ 600dpi px @ 300dpi hwmargin (pt) @ 600dpi hwmargin (pt) @ 300dpi
Letter 8.50 x 11.00 215.9 x 279.4 4863 x 6363 2431 x 3181 14.22 x 14.22 14.28 x 14.28
Legal 8.50 x 14.00 215.9 x 355.6 4863 x 2431 x 14.22 x 14.28 x
Executive 7.25 x 10.50 184.2 x 266.7 4112 x 6063 2056 x 3031 14.28 x 14.22 14.28 x 14.28
A5 5.83 x 8.27 148 x 210 3259 x 4724 1629 x 2362 14.34 x 14.28 14.40 x 14.28
B5 7.17 x 10.12 182 x 257 4062 x 5834 2031 x 2917 14.40 x 14.28 14.40 x 14.28
A4 8.27 x 11.69 210 x 297 4724x6779 2362 x 3389 14.16 x 14.16 14.28 x 14.16
Monarch 3.87 x 7.50 98.4 x 190.5
COM10 4.12 x 9.50 104.7 x 241.3
DL 4.33 x 8.66 110 x 220
C5 3.87 x 7.50 162 x 229
??? 8.27 x 11.69 210 x 297

Driver render size page

format px@ 600dpi px@ 300dpi
A4 4720x6768 2360x3384
A5 3264x4720 1632x2630
B5 4056x5824 2028x2912
Executive 4104x6056 2052x3028
Legal 4856x8160 2428x4080
env С5 3584x5168 1792x2584
env COM10 2232x5456 1116x2728
env DL 2352x4952 1176x2476
env Monar 2080x4256 1040x2128
??? 4716x6764 2358x3382

left offset print area is 5.165mm pixel chages after 0,085mm. 0,085mm * 2360(px) = 200,6 mm 210mm (width A4) - 5.165mm * 2 = 199,67mm. 199,67 / 2360 = 0,084605932 mm/px

14,25×1÷72 = 0,197916667×25,4 = 5,027083342 mm 5,165÷25,4×72 = 14,640944882

HWMargins

for A4 paper size

pixels margins1 margins2 margins3 margins4
4715x6774 14.579999923706 14.579999923706 14.579999923706 14.579999923706
4721x6779 14.250000 14.250000 14.250000 14.250000
4720x6779 14.280000 14.280000 14.280029 14.280029
4720x6778 14.290000 14.290000 14.289978 14.289978
4720x6778 14.300000 14.300000 14.299988 14.299988
4720x6778 14.320000 14.320000 14.320007 14.320007
4719x6778 14.340000 14.340000 14.340027 14.340027
4720x6777 14.300000 14.400000 14.299988 14.400024
4720x6773 14.300000 14.600000 14.299988 14.599976
4720x6768 14.300000 14.900000 14.299988 14.900024

COMPRESSED DATA format:

compression CCITT Group 4 as T6, T.6, Fax4, G4, Group 4, or ITU-T Fax Group 4.