From 5c021f64772d9011ea6b7515196deb4806ae603d Mon Sep 17 00:00:00 2001 From: mounaiban <29518031+mounaiban@users.noreply.github.com> Date: Wed, 27 Jun 2018 14:12:15 +1000 Subject: [PATCH 1/6] Fix LBP3000 support, add multiple page sizes --- Canon-LBP-2900.ppd | 88 ------------ Canon-LBP2900.ppd | 337 ++++++++++++++++++++++++++++++++++++++++++++ Canon-LBP3000.ppd | 342 +++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 2 +- src/canon-lbp.drv | 126 +++++++++++++++++ src/paper.c | 2 + src/paper.h | 4 +- src/prn_lbp2900.c | 44 +++--- 8 files changed, 832 insertions(+), 113 deletions(-) delete mode 100644 Canon-LBP-2900.ppd create mode 100644 Canon-LBP2900.ppd create mode 100644 Canon-LBP3000.ppd create mode 100644 src/canon-lbp.drv diff --git a/Canon-LBP-2900.ppd b/Canon-LBP-2900.ppd deleted file mode 100644 index 0c2acf1..0000000 --- a/Canon-LBP-2900.ppd +++ /dev/null @@ -1,88 +0,0 @@ -*PPD-Adobe: "4.3" -*%%%% PPD file for LBP-2900 CAPT GDI printer with CUPS. -*%%%% Created by the CUPS PPD Compiler CUPS v1.5.3. -*% Copyright (C) 2011 Alexey Galakhov -*FormatVersion: "4.3" -*FileVersion: "0.1.0" -*LanguageVersion: English -*LanguageEncoding: ISOLatin1 -*PCFileName: "Canon-LBP-2900.ppd" -*Product: "(LBP-2900 CAPT GDI printer)" -*Manufacturer: "Canon" -*ModelName: "Canon LBP-2900 CAPT GDI printer" -*ShortNickName: "Canon LBP-2900 CAPT GDI printer" -*NickName: "Canon LBP-2900 CAPT GDI printer, 0.1.0" -*PSVersion: "(3010.000) 0" -*LanguageLevel: "3" -*ColorDevice: False -*DefaultColorSpace: Gray -*FileSystem: False -*Throughput: "1" -*LandscapeOrientation: Plus90 -*TTRasterizer: Type42 -*cupsVersion: 1.5 -*cupsModelNumber: 0 -*cupsManualCopies: False -*cupsFilter: "application/vnd.cups-raster 1 rastertocapt" -*cupsLanguages: "en" -*OpenUI *PageSize/Media Size: PickOne -*OrderDependency: 10 AnySetup *PageSize -*DefaultPageSize: A4 -*PageSize A4/A4: "<>setpagedevice" -*CloseUI: *PageSize -*OpenUI *PageRegion/Media Size: PickOne -*OrderDependency: 10 AnySetup *PageRegion -*DefaultPageRegion: A4 -*PageRegion A4/A4: "<>setpagedevice" -*CloseUI: *PageRegion -*DefaultImageableArea: A4 -*ImageableArea A4/A4: "13.35000038147 13.35000038147 581.650024414062 828.650024414062" -*DefaultPaperDimension: A4 -*PaperDimension A4/A4: "595 842" -*OpenUI *ColorModel/Color Mode: PickOne -*OrderDependency: 10 AnySetup *ColorModel -*DefaultColorModel: Gray -*ColorModel Gray/Grayscale: "<>setpagedevice" -*CloseUI: *ColorModel -*OpenUI *Resolution/Resolution: PickOne -*OrderDependency: 10 AnySetup *Resolution -*DefaultResolution: 600dpi -*Resolution 600dpi/600 DPI: "<>setpagedevice" -*CloseUI: *Resolution -*DefaultFont: Courier -*Font AvantGarde-Book: Standard "(1.05)" Standard ROM -*Font AvantGarde-BookOblique: Standard "(1.05)" Standard ROM -*Font AvantGarde-Demi: Standard "(1.05)" Standard ROM -*Font AvantGarde-DemiOblique: Standard "(1.05)" Standard ROM -*Font Bookman-Demi: Standard "(1.05)" Standard ROM -*Font Bookman-DemiItalic: Standard "(1.05)" Standard ROM -*Font Bookman-Light: Standard "(1.05)" Standard ROM -*Font Bookman-LightItalic: Standard "(1.05)" Standard ROM -*Font Courier: Standard "(1.05)" Standard ROM -*Font Courier-Bold: Standard "(1.05)" Standard ROM -*Font Courier-BoldOblique: Standard "(1.05)" Standard ROM -*Font Courier-Oblique: Standard "(1.05)" Standard ROM -*Font Helvetica: Standard "(1.05)" Standard ROM -*Font Helvetica-Bold: Standard "(1.05)" Standard ROM -*Font Helvetica-BoldOblique: Standard "(1.05)" Standard ROM -*Font Helvetica-Narrow: Standard "(1.05)" Standard ROM -*Font Helvetica-Narrow-Bold: Standard "(1.05)" Standard ROM -*Font Helvetica-Narrow-BoldOblique: Standard "(1.05)" Standard ROM -*Font Helvetica-Narrow-Oblique: Standard "(1.05)" Standard ROM -*Font Helvetica-Oblique: Standard "(1.05)" Standard ROM -*Font NewCenturySchlbk-Bold: Standard "(1.05)" Standard ROM -*Font NewCenturySchlbk-BoldItalic: Standard "(1.05)" Standard ROM -*Font NewCenturySchlbk-Italic: Standard "(1.05)" Standard ROM -*Font NewCenturySchlbk-Roman: Standard "(1.05)" Standard ROM -*Font Palatino-Bold: Standard "(1.05)" Standard ROM -*Font Palatino-BoldItalic: Standard "(1.05)" Standard ROM -*Font Palatino-Italic: Standard "(1.05)" Standard ROM -*Font Palatino-Roman: Standard "(1.05)" Standard ROM -*Font Symbol: Special "(001.005)" Special ROM -*Font Times-Bold: Standard "(1.05)" Standard ROM -*Font Times-BoldItalic: Standard "(1.05)" Standard ROM -*Font Times-Italic: Standard "(1.05)" Standard ROM -*Font Times-Roman: Standard "(1.05)" Standard ROM -*Font ZapfChancery-MediumItalic: Standard "(1.05)" Standard ROM -*Font ZapfDingbats: Special "(001.005)" Special ROM -*% End of Canon-LBP-2900.ppd, 03920 bytes. diff --git a/Canon-LBP2900.ppd b/Canon-LBP2900.ppd new file mode 100644 index 0000000..a42e1f5 --- /dev/null +++ b/Canon-LBP2900.ppd @@ -0,0 +1,337 @@ +*PPD-Adobe: "4.3" +*%%%% PPD file for LBP2900/LBP3010 r2c with CUPS. +*%%%% Created by the CUPS PPD Compiler CUPS v2.2.10. +*% (C)2020 Moses Chong +*FormatVersion: "4.3" +*FileVersion: "0.1.2" +*LanguageVersion: English +*LanguageEncoding: ISOLatin1 +*PCFileName: "CNLB2K9.ppd" +*Product: "(LBP2900/LBP3010 r2c)" +*Manufacturer: "Canon Inc" +*ModelName: "Canon Inc LBP2900/LBP3010 r2c" +*ShortNickName: "Canon Inc LBP2900/LBP3010 r2c" +*NickName: "Canon Inc LBP2900/LBP3010 r2c, 0.1.2" +*PSVersion: "(3010.000) 0" +*LanguageLevel: "3" +*ColorDevice: False +*DefaultColorSpace: Gray +*FileSystem: False +*Throughput: "1" +*LandscapeOrientation: Plus90 +*TTRasterizer: Type42 +*cupsVersion: 2.2 +*cupsModelNumber: 0 +*cupsManualCopies: False +*cupsFilter: "application/vnd.cups-raster 1 rastertocapt" +*cupsLanguages: "en" +*OpenUI *PageSize/Media Size: PickOne +*OrderDependency: 10 AnySetup *PageSize +*DefaultPageSize: A4 +*PageSize A4/A4: "<>setpagedevice" +*PageSize A5/A5: "<>setpagedevice" +*PageSize A6/A6: "<>setpagedevice" +*PageSize B6/JIS B6: "<>setpagedevice" +*PageSize C6/Envelope C6: "<>setpagedevice" +*PageSize EnvC5/Envelope C5: "<>setpagedevice" +*PageSize EnvC6/Envelope C6: "<>setpagedevice" +*PageSize EnvChou3/Envelope Choukei 3: "<>setpagedevice" +*PageSize EnvDL/Envelope DL: "<>setpagedevice" +*PageSize Env10/Envelope #10: "<>setpagedevice" +*PageSize EnvItalian/Envelope Italian: "<>setpagedevice" +*PageSize Executive/Executive: "<>setpagedevice" +*PageSize Folio/Folio: "<>setpagedevice" +*PageSize Legal/US Legal: "<>setpagedevice" +*PageSize Letter/US Letter: "<>setpagedevice" +*PageSize SISG5/SIS G5: "<>setpagedevice" +*PageSize SISE5/SIS E5: "<>setpagedevice" +*PageSize SAC16K/SAC 16K: "<>setpagedevice" +*PageSize SAC32K/SAC 32K: "<>setpagedevice" +*PageSize 7x9/7 x 9: "<>setpagedevice" +*PageSize 8x10/8 x 10: "<>setpagedevice" +*PageSize A4Small/A4 Small: "<>setpagedevice" +*PageSize A4Plus/A4 Oversize: "<>setpagedevice" +*PageSize A5Extra/A5 Oversize: "<>setpagedevice" +*PageSize B5/JIS B5: "<>setpagedevice" +*PageSize B7/JIS B7: "<>setpagedevice" +*PageSize DoublePostcard/Postcard Double: "<>setpagedevice" +*PageSize Env9/Envelope #9: "<>setpagedevice" +*PageSize Env11/Envelope #11: "<>setpagedevice" +*PageSize Env12/Envelope #12: "<>setpagedevice" +*PageSize Env14/Envelope #14: "<>setpagedevice" +*PageSize EnvC65/Envelope C65: "<>setpagedevice" +*PageSize EnvChou4/Envelope Choukei 4: "<>setpagedevice" +*PageSize EnvISOB5/Envelope B5: "<>setpagedevice" +*PageSize EnvISOB6/Envelope B6: "<>setpagedevice" +*PageSize EnvKaku3/Envelope Kaku3: "<>setpagedevice" +*PageSize EnvMonarch/Envelope Monarch: "<>setpagedevice" +*PageSize EnvPersonal/Envelope Personal: "<>setpagedevice" +*PageSize EnvPRC1/Envelope PRC1: "<>setpagedevice" +*PageSize EnvPRC2/Envelope PRC2: "<>setpagedevice" +*PageSize EnvPRC3/Envelope PRC3: "<>setpagedevice" +*PageSize EnvPRC4/Envelope PRC4: "<>setpagedevice" +*PageSize EnvPRC5/Envelope PRC5PRC5: "<>setpagedevice" +*PageSize EnvPRC6/Envelope PRC6: "<>setpagedevice" +*PageSize EnvPRC7/Envelope PRC7: "<>setpagedevice" +*PageSize EnvPRC8/Envelope PRC8: "<>setpagedevice" +*PageSize EnvYou4/Envelope You4: "<>setpagedevice" +*PageSize FanFoldGerman/European Fanfold: "<>setpagedevice" +*PageSize FanFoldGermanLegal/European Fanfold Legal: "<>setpagedevice" +*PageSize ISOB5/B5: "<>setpagedevice" +*PageSize ISOB5Extra/B5 Oversize: "<>setpagedevice" +*PageSize ISOB6/B6: "<>setpagedevice" +*PageSize ISOB7/B7: "<>setpagedevice" +*PageSize LetterPlus/US Letter Oversize: "<>setpagedevice" +*PageSize Note/Note: "<>setpagedevice" +*PageSize Postcard/Postcard: "<>setpagedevice" +*PageSize PRC16K/PRC16K: "<>setpagedevice" +*PageSize PRC32K/PRC32K: "<>setpagedevice" +*PageSize PRC32KBig/PRC32K Oversize: "<>setpagedevice" +*PageSize Quarto/Quarto: "<>setpagedevice" +*PageSize Statement/Statement: "<>setpagedevice" +*CloseUI: *PageSize +*OpenUI *PageRegion/Media Size: PickOne +*OrderDependency: 10 AnySetup *PageRegion +*DefaultPageRegion: A4 +*PageRegion A4/A4: "<>setpagedevice" +*PageRegion A5/A5: "<>setpagedevice" +*PageRegion A6/A6: "<>setpagedevice" +*PageRegion B6/JIS B6: "<>setpagedevice" +*PageRegion C6/Envelope C6: "<>setpagedevice" +*PageRegion EnvC5/Envelope C5: "<>setpagedevice" +*PageRegion EnvC6/Envelope C6: "<>setpagedevice" +*PageRegion EnvChou3/Envelope Choukei 3: "<>setpagedevice" +*PageRegion EnvDL/Envelope DL: "<>setpagedevice" +*PageRegion Env10/Envelope #10: "<>setpagedevice" +*PageRegion EnvItalian/Envelope Italian: "<>setpagedevice" +*PageRegion Executive/Executive: "<>setpagedevice" +*PageRegion Folio/Folio: "<>setpagedevice" +*PageRegion Legal/US Legal: "<>setpagedevice" +*PageRegion Letter/US Letter: "<>setpagedevice" +*PageRegion SISG5/SIS G5: "<>setpagedevice" +*PageRegion SISE5/SIS E5: "<>setpagedevice" +*PageRegion SAC16K/SAC 16K: "<>setpagedevice" +*PageRegion SAC32K/SAC 32K: "<>setpagedevice" +*PageRegion 7x9/7 x 9: "<>setpagedevice" +*PageRegion 8x10/8 x 10: "<>setpagedevice" +*PageRegion A4Small/A4 Small: "<>setpagedevice" +*PageRegion A4Plus/A4 Oversize: "<>setpagedevice" +*PageRegion A5Extra/A5 Oversize: "<>setpagedevice" +*PageRegion B5/JIS B5: "<>setpagedevice" +*PageRegion B7/JIS B7: "<>setpagedevice" +*PageRegion DoublePostcard/Postcard Double: "<>setpagedevice" +*PageRegion Env9/Envelope #9: "<>setpagedevice" +*PageRegion Env11/Envelope #11: "<>setpagedevice" +*PageRegion Env12/Envelope #12: "<>setpagedevice" +*PageRegion Env14/Envelope #14: "<>setpagedevice" +*PageRegion EnvC65/Envelope C65: "<>setpagedevice" +*PageRegion EnvChou4/Envelope Choukei 4: "<>setpagedevice" +*PageRegion EnvISOB5/Envelope B5: "<>setpagedevice" +*PageRegion EnvISOB6/Envelope B6: "<>setpagedevice" +*PageRegion EnvKaku3/Envelope Kaku3: "<>setpagedevice" +*PageRegion EnvMonarch/Envelope Monarch: "<>setpagedevice" +*PageRegion EnvPersonal/Envelope Personal: "<>setpagedevice" +*PageRegion EnvPRC1/Envelope PRC1: "<>setpagedevice" +*PageRegion EnvPRC2/Envelope PRC2: "<>setpagedevice" +*PageRegion EnvPRC3/Envelope PRC3: "<>setpagedevice" +*PageRegion EnvPRC4/Envelope PRC4: "<>setpagedevice" +*PageRegion EnvPRC5/Envelope PRC5PRC5: "<>setpagedevice" +*PageRegion EnvPRC6/Envelope PRC6: "<>setpagedevice" +*PageRegion EnvPRC7/Envelope PRC7: "<>setpagedevice" +*PageRegion EnvPRC8/Envelope PRC8: "<>setpagedevice" +*PageRegion EnvYou4/Envelope You4: "<>setpagedevice" +*PageRegion FanFoldGerman/European Fanfold: "<>setpagedevice" +*PageRegion FanFoldGermanLegal/European Fanfold Legal: "<>setpagedevice" +*PageRegion ISOB5/B5: "<>setpagedevice" +*PageRegion ISOB5Extra/B5 Oversize: "<>setpagedevice" +*PageRegion ISOB6/B6: "<>setpagedevice" +*PageRegion ISOB7/B7: "<>setpagedevice" +*PageRegion LetterPlus/US Letter Oversize: "<>setpagedevice" +*PageRegion Note/Note: "<>setpagedevice" +*PageRegion Postcard/Postcard: "<>setpagedevice" +*PageRegion PRC16K/PRC16K: "<>setpagedevice" +*PageRegion PRC32K/PRC32K: "<>setpagedevice" +*PageRegion PRC32KBig/PRC32K Oversize: "<>setpagedevice" +*PageRegion Quarto/Quarto: "<>setpagedevice" +*PageRegion Statement/Statement: "<>setpagedevice" +*CloseUI: *PageRegion +*DefaultImageableArea: A4 +*ImageableArea A4/A4: "0 0 595 842" +*ImageableArea A5/A5: "0 0 420 595" +*ImageableArea A6/A6: "0 0 297 420" +*ImageableArea B6/JIS B6: "0 0 363 516" +*ImageableArea C6/Envelope C6: "0 0 323 459" +*ImageableArea EnvC5/Envelope C5: "0 0 459 649" +*ImageableArea EnvC6/Envelope C6: "0 0 323 459" +*ImageableArea EnvChou3/Envelope Choukei 3: "0 0 340 666" +*ImageableArea EnvDL/Envelope DL: "0 0 312 624" +*ImageableArea Env10/Envelope #10: "0 0 297 684" +*ImageableArea EnvItalian/Envelope Italian: "0 0 312 652" +*ImageableArea Executive/Executive: "0 0 522 756" +*ImageableArea Folio/Folio: "0 0 595 935" +*ImageableArea Legal/US Legal: "0 0 612 1008" +*ImageableArea Letter/US Letter: "0 0 612 792" +*ImageableArea SISG5/SIS G5: "0 0 479.055145263672 677.480346679688" +*ImageableArea SISE5/SIS E5: "0 0 325.984252929688 623.6220703125" +*ImageableArea SAC16K/SAC 16K: "0 0 532.913391113281 737.007873535156" +*ImageableArea SAC32K/SAC 32K: "0 0 368.503936767578 521.574829101562" +*ImageableArea 7x9/7 x 9: "0 0 504 648" +*ImageableArea 8x10/8 x 10: "0 0 576 720" +*ImageableArea A4Small/A4 Small: "0 0 595 842" +*ImageableArea A4Plus/A4 Oversize: "0 0 595 936" +*ImageableArea A5Extra/A5 Oversize: "0 0 492 668" +*ImageableArea B5/JIS B5: "0 0 516 729" +*ImageableArea B7/JIS B7: "0 0 258 363" +*ImageableArea DoublePostcard/Postcard Double: "0 0 567 420" +*ImageableArea Env9/Envelope #9: "0 0 279 639" +*ImageableArea Env11/Envelope #11: "0 0 324 747" +*ImageableArea Env12/Envelope #12: "0 0 342 792" +*ImageableArea Env14/Envelope #14: "0 0 360 828" +*ImageableArea EnvC65/Envelope C65: "0 0 324 648" +*ImageableArea EnvChou4/Envelope Choukei 4: "0 0 255 581" +*ImageableArea EnvISOB5/Envelope B5: "0 0 499 709" +*ImageableArea EnvISOB6/Envelope B6: "0 0 499 354" +*ImageableArea EnvKaku3/Envelope Kaku3: "0 0 612 785" +*ImageableArea EnvMonarch/Envelope Monarch: "0 0 279 540" +*ImageableArea EnvPersonal/Envelope Personal: "0 0 261 468" +*ImageableArea EnvPRC1/Envelope PRC1: "0 0 289 468" +*ImageableArea EnvPRC2/Envelope PRC2: "0 0 289 499" +*ImageableArea EnvPRC3/Envelope PRC3: "0 0 354 499" +*ImageableArea EnvPRC4/Envelope PRC4: "0 0 312 590" +*ImageableArea EnvPRC5/Envelope PRC5PRC5: "0 0 312 624" +*ImageableArea EnvPRC6/Envelope PRC6: "0 0 340 652" +*ImageableArea EnvPRC7/Envelope PRC7: "0 0 454 652" +*ImageableArea EnvPRC8/Envelope PRC8: "0 0 340 876" +*ImageableArea EnvYou4/Envelope You4: "0 0 298 666" +*ImageableArea FanFoldGerman/European Fanfold: "0 0 612 864" +*ImageableArea FanFoldGermanLegal/European Fanfold Legal: "0 0 612 936" +*ImageableArea ISOB5/B5: "0 0 499 709" +*ImageableArea ISOB5Extra/B5 Oversize: "0 0 570 782" +*ImageableArea ISOB6/B6: "0 0 354 499" +*ImageableArea ISOB7/B7: "0 0 249 354" +*ImageableArea LetterPlus/US Letter Oversize: "0 0 612 914" +*ImageableArea Note/Note: "0 0 612 792" +*ImageableArea Postcard/Postcard: "0 0 284 419" +*ImageableArea PRC16K/PRC16K: "0 0 414 610" +*ImageableArea PRC32K/PRC32K: "0 0 275 428" +*ImageableArea PRC32KBig/PRC32K Oversize: "0 0 275 428" +*ImageableArea Quarto/Quarto: "0 0 610 780" +*ImageableArea Statement/Statement: "0 0 396 612" +*DefaultPaperDimension: A4 +*PaperDimension A4/A4: "595 842" +*PaperDimension A5/A5: "420 595" +*PaperDimension A6/A6: "297 420" +*PaperDimension B6/JIS B6: "363 516" +*PaperDimension C6/Envelope C6: "323 459" +*PaperDimension EnvC5/Envelope C5: "459 649" +*PaperDimension EnvC6/Envelope C6: "323 459" +*PaperDimension EnvChou3/Envelope Choukei 3: "340 666" +*PaperDimension EnvDL/Envelope DL: "312 624" +*PaperDimension Env10/Envelope #10: "297 684" +*PaperDimension EnvItalian/Envelope Italian: "312 652" +*PaperDimension Executive/Executive: "522 756" +*PaperDimension Folio/Folio: "595 935" +*PaperDimension Legal/US Legal: "612 1008" +*PaperDimension Letter/US Letter: "612 792" +*PaperDimension SISG5/SIS G5: "479.055145263672 677.480346679688" +*PaperDimension SISE5/SIS E5: "325.984252929688 623.6220703125" +*PaperDimension SAC16K/SAC 16K: "532.913391113281 737.007873535156" +*PaperDimension SAC32K/SAC 32K: "368.503936767578 521.574829101562" +*PaperDimension 7x9/7 x 9: "504 648" +*PaperDimension 8x10/8 x 10: "576 720" +*PaperDimension A4Small/A4 Small: "595 842" +*PaperDimension A4Plus/A4 Oversize: "595 936" +*PaperDimension A5Extra/A5 Oversize: "492 668" +*PaperDimension B5/JIS B5: "516 729" +*PaperDimension B7/JIS B7: "258 363" +*PaperDimension DoublePostcard/Postcard Double: "567 420" +*PaperDimension Env9/Envelope #9: "279 639" +*PaperDimension Env11/Envelope #11: "324 747" +*PaperDimension Env12/Envelope #12: "342 792" +*PaperDimension Env14/Envelope #14: "360 828" +*PaperDimension EnvC65/Envelope C65: "324 648" +*PaperDimension EnvChou4/Envelope Choukei 4: "255 581" +*PaperDimension EnvISOB5/Envelope B5: "499 709" +*PaperDimension EnvISOB6/Envelope B6: "499 354" +*PaperDimension EnvKaku3/Envelope Kaku3: "612 785" +*PaperDimension EnvMonarch/Envelope Monarch: "279 540" +*PaperDimension EnvPersonal/Envelope Personal: "261 468" +*PaperDimension EnvPRC1/Envelope PRC1: "289 468" +*PaperDimension EnvPRC2/Envelope PRC2: "289 499" +*PaperDimension EnvPRC3/Envelope PRC3: "354 499" +*PaperDimension EnvPRC4/Envelope PRC4: "312 590" +*PaperDimension EnvPRC5/Envelope PRC5PRC5: "312 624" +*PaperDimension EnvPRC6/Envelope PRC6: "340 652" +*PaperDimension EnvPRC7/Envelope PRC7: "454 652" +*PaperDimension EnvPRC8/Envelope PRC8: "340 876" +*PaperDimension EnvYou4/Envelope You4: "298 666" +*PaperDimension FanFoldGerman/European Fanfold: "612 864" +*PaperDimension FanFoldGermanLegal/European Fanfold Legal: "612 936" +*PaperDimension ISOB5/B5: "499 709" +*PaperDimension ISOB5Extra/B5 Oversize: "570 782" +*PaperDimension ISOB6/B6: "354 499" +*PaperDimension ISOB7/B7: "249 354" +*PaperDimension LetterPlus/US Letter Oversize: "612 914" +*PaperDimension Note/Note: "612 792" +*PaperDimension Postcard/Postcard: "284 419" +*PaperDimension PRC16K/PRC16K: "414 610" +*PaperDimension PRC32K/PRC32K: "275 428" +*PaperDimension PRC32KBig/PRC32K Oversize: "275 428" +*PaperDimension Quarto/Quarto: "610 780" +*PaperDimension Statement/Statement: "396 612" +*MaxMediaWidth: "612" +*MaxMediaHeight: "1008.000061035156" +*HWMargins: 13.35000038147 13.35000038147 13.349998474121 13.349998474121 +*CustomPageSize True: "pop pop pop <>setpagedevice" +*ParamCustomPageSize Width: 1 points 212.598434448242 612 +*ParamCustomPageSize Height: 2 points 297.637817382812 1008.000061035156 +*ParamCustomPageSize WidthOffset: 3 points 0 0 +*ParamCustomPageSize HeightOffset: 4 points 0 0 +*ParamCustomPageSize Orientation: 5 int 0 0 +*OpenUI *ColorModel/Color Mode: PickOne +*OrderDependency: 10 AnySetup *ColorModel +*DefaultColorModel: Gray +*ColorModel Gray/Grayscale: "<>setpagedevice" +*CloseUI: *ColorModel +*OpenUI *Resolution/Resolution: PickOne +*OrderDependency: 10 AnySetup *Resolution +*DefaultResolution: 600dpi +*Resolution 600dpi/600 DPI: "<>setpagedevice" +*CloseUI: *Resolution +*DefaultFont: Courier +*Font AvantGarde-Book: Standard "(1.05)" Standard ROM +*Font AvantGarde-BookOblique: Standard "(1.05)" Standard ROM +*Font AvantGarde-Demi: Standard "(1.05)" Standard ROM +*Font AvantGarde-DemiOblique: Standard "(1.05)" Standard ROM +*Font Bookman-Demi: Standard "(1.05)" Standard ROM +*Font Bookman-DemiItalic: Standard "(1.05)" Standard ROM +*Font Bookman-Light: Standard "(1.05)" Standard ROM +*Font Bookman-LightItalic: Standard "(1.05)" Standard ROM +*Font Courier: Standard "(1.05)" Standard ROM +*Font Courier-Bold: Standard "(1.05)" Standard ROM +*Font Courier-BoldOblique: Standard "(1.05)" Standard ROM +*Font Courier-Oblique: Standard "(1.05)" Standard ROM +*Font Helvetica: Standard "(1.05)" Standard ROM +*Font Helvetica-Bold: Standard "(1.05)" Standard ROM +*Font Helvetica-BoldOblique: Standard "(1.05)" Standard ROM +*Font Helvetica-Narrow: Standard "(1.05)" Standard ROM +*Font Helvetica-Narrow-Bold: Standard "(1.05)" Standard ROM +*Font Helvetica-Narrow-BoldOblique: Standard "(1.05)" Standard ROM +*Font Helvetica-Narrow-Oblique: Standard "(1.05)" Standard ROM +*Font Helvetica-Oblique: Standard "(1.05)" Standard ROM +*Font NewCenturySchlbk-Bold: Standard "(1.05)" Standard ROM +*Font NewCenturySchlbk-BoldItalic: Standard "(1.05)" Standard ROM +*Font NewCenturySchlbk-Italic: Standard "(1.05)" Standard ROM +*Font NewCenturySchlbk-Roman: Standard "(1.05)" Standard ROM +*Font Palatino-Bold: Standard "(1.05)" Standard ROM +*Font Palatino-BoldItalic: Standard "(1.05)" Standard ROM +*Font Palatino-Italic: Standard "(1.05)" Standard ROM +*Font Palatino-Roman: Standard "(1.05)" Standard ROM +*Font Symbol: Special "(001.005)" Special ROM +*Font Times-Bold: Standard "(1.05)" Standard ROM +*Font Times-BoldItalic: Standard "(1.05)" Standard ROM +*Font Times-Italic: Standard "(1.05)" Standard ROM +*Font Times-Roman: Standard "(1.05)" Standard ROM +*Font ZapfChancery-MediumItalic: Standard "(1.05)" Standard ROM +*Font ZapfDingbats: Special "(001.005)" Special ROM +*% End of CNLB2K9.ppd, 20521 bytes. diff --git a/Canon-LBP3000.ppd b/Canon-LBP3000.ppd new file mode 100644 index 0000000..5f1341f --- /dev/null +++ b/Canon-LBP3000.ppd @@ -0,0 +1,342 @@ +*PPD-Adobe: "4.3" +*%%%% PPD file for LBP3000 r2c with CUPS. +*%%%% Created by the CUPS PPD Compiler CUPS v2.2.10. +*% (C)2020 Moses Chong +*FormatVersion: "4.3" +*FileVersion: "0.1.2" +*LanguageVersion: English +*LanguageEncoding: ISOLatin1 +*PCFileName: "CNLB3K.ppd" +*Product: "(LBP3000 r2c)" +*Manufacturer: "Canon Inc" +*ModelName: "Canon Inc LBP3000 r2c" +*ShortNickName: "Canon Inc LBP3000 r2c" +*NickName: "Canon Inc LBP3000 r2c, 0.1.2" +*PSVersion: "(3010.000) 0" +*LanguageLevel: "3" +*ColorDevice: False +*DefaultColorSpace: Gray +*FileSystem: False +*Throughput: "1" +*LandscapeOrientation: Plus90 +*TTRasterizer: Type42 +*cupsVersion: 2.2 +*cupsModelNumber: 0 +*cupsManualCopies: False +*cupsFilter: "application/vnd.cups-raster 1 rastertocapt" +*cupsLanguages: "en" +*OpenUI *PageSize/Media Size: PickOne +*OrderDependency: 10 AnySetup *PageSize +*DefaultPageSize: A4 +*PageSize A4/A4: "<>setpagedevice" +*PageSize A5/A5: "<>setpagedevice" +*PageSize A6/A6: "<>setpagedevice" +*PageSize B6/JIS B6: "<>setpagedevice" +*PageSize C6/Envelope C6: "<>setpagedevice" +*PageSize EnvC5/Envelope C5: "<>setpagedevice" +*PageSize EnvC6/Envelope C6: "<>setpagedevice" +*PageSize EnvChou3/Envelope Choukei 3: "<>setpagedevice" +*PageSize EnvDL/Envelope DL: "<>setpagedevice" +*PageSize Env10/Envelope #10: "<>setpagedevice" +*PageSize EnvItalian/Envelope Italian: "<>setpagedevice" +*PageSize Executive/Executive: "<>setpagedevice" +*PageSize Folio/Folio: "<>setpagedevice" +*PageSize Legal/US Legal: "<>setpagedevice" +*PageSize Letter/US Letter: "<>setpagedevice" +*PageSize SISG5/SIS G5: "<>setpagedevice" +*PageSize SISE5/SIS E5: "<>setpagedevice" +*PageSize SAC16K/SAC 16K: "<>setpagedevice" +*PageSize SAC32K/SAC 32K: "<>setpagedevice" +*PageSize 7x9/7 x 9: "<>setpagedevice" +*PageSize 8x10/8 x 10: "<>setpagedevice" +*PageSize A4Small/A4 Small: "<>setpagedevice" +*PageSize A4Plus/A4 Oversize: "<>setpagedevice" +*PageSize A5Extra/A5 Oversize: "<>setpagedevice" +*PageSize B5/JIS B5: "<>setpagedevice" +*PageSize B7/JIS B7: "<>setpagedevice" +*PageSize DoublePostcard/Postcard Double: "<>setpagedevice" +*PageSize Env9/Envelope #9: "<>setpagedevice" +*PageSize Env11/Envelope #11: "<>setpagedevice" +*PageSize Env12/Envelope #12: "<>setpagedevice" +*PageSize Env14/Envelope #14: "<>setpagedevice" +*PageSize EnvC65/Envelope C65: "<>setpagedevice" +*PageSize EnvChou4/Envelope Choukei 4: "<>setpagedevice" +*PageSize EnvISOB5/Envelope B5: "<>setpagedevice" +*PageSize EnvISOB6/Envelope B6: "<>setpagedevice" +*PageSize EnvKaku3/Envelope Kaku3: "<>setpagedevice" +*PageSize EnvMonarch/Envelope Monarch: "<>setpagedevice" +*PageSize EnvPersonal/Envelope Personal: "<>setpagedevice" +*PageSize EnvPRC1/Envelope PRC1: "<>setpagedevice" +*PageSize EnvPRC2/Envelope PRC2: "<>setpagedevice" +*PageSize EnvPRC3/Envelope PRC3: "<>setpagedevice" +*PageSize EnvPRC4/Envelope PRC4: "<>setpagedevice" +*PageSize EnvPRC5/Envelope PRC5PRC5: "<>setpagedevice" +*PageSize EnvPRC6/Envelope PRC6: "<>setpagedevice" +*PageSize EnvPRC7/Envelope PRC7: "<>setpagedevice" +*PageSize EnvPRC8/Envelope PRC8: "<>setpagedevice" +*PageSize EnvYou4/Envelope You4: "<>setpagedevice" +*PageSize FanFoldGerman/European Fanfold: "<>setpagedevice" +*PageSize FanFoldGermanLegal/European Fanfold Legal: "<>setpagedevice" +*PageSize ISOB5/B5: "<>setpagedevice" +*PageSize ISOB5Extra/B5 Oversize: "<>setpagedevice" +*PageSize ISOB6/B6: "<>setpagedevice" +*PageSize ISOB7/B7: "<>setpagedevice" +*PageSize LetterPlus/US Letter Oversize: "<>setpagedevice" +*PageSize Note/Note: "<>setpagedevice" +*PageSize Postcard/Postcard: "<>setpagedevice" +*PageSize PRC16K/PRC16K: "<>setpagedevice" +*PageSize PRC32K/PRC32K: "<>setpagedevice" +*PageSize PRC32KBig/PRC32K Oversize: "<>setpagedevice" +*PageSize Quarto/Quarto: "<>setpagedevice" +*PageSize Statement/Statement: "<>setpagedevice" +*CloseUI: *PageSize +*OpenUI *PageRegion/Media Size: PickOne +*OrderDependency: 10 AnySetup *PageRegion +*DefaultPageRegion: A4 +*PageRegion A4/A4: "<>setpagedevice" +*PageRegion A5/A5: "<>setpagedevice" +*PageRegion A6/A6: "<>setpagedevice" +*PageRegion B6/JIS B6: "<>setpagedevice" +*PageRegion C6/Envelope C6: "<>setpagedevice" +*PageRegion EnvC5/Envelope C5: "<>setpagedevice" +*PageRegion EnvC6/Envelope C6: "<>setpagedevice" +*PageRegion EnvChou3/Envelope Choukei 3: "<>setpagedevice" +*PageRegion EnvDL/Envelope DL: "<>setpagedevice" +*PageRegion Env10/Envelope #10: "<>setpagedevice" +*PageRegion EnvItalian/Envelope Italian: "<>setpagedevice" +*PageRegion Executive/Executive: "<>setpagedevice" +*PageRegion Folio/Folio: "<>setpagedevice" +*PageRegion Legal/US Legal: "<>setpagedevice" +*PageRegion Letter/US Letter: "<>setpagedevice" +*PageRegion SISG5/SIS G5: "<>setpagedevice" +*PageRegion SISE5/SIS E5: "<>setpagedevice" +*PageRegion SAC16K/SAC 16K: "<>setpagedevice" +*PageRegion SAC32K/SAC 32K: "<>setpagedevice" +*PageRegion 7x9/7 x 9: "<>setpagedevice" +*PageRegion 8x10/8 x 10: "<>setpagedevice" +*PageRegion A4Small/A4 Small: "<>setpagedevice" +*PageRegion A4Plus/A4 Oversize: "<>setpagedevice" +*PageRegion A5Extra/A5 Oversize: "<>setpagedevice" +*PageRegion B5/JIS B5: "<>setpagedevice" +*PageRegion B7/JIS B7: "<>setpagedevice" +*PageRegion DoublePostcard/Postcard Double: "<>setpagedevice" +*PageRegion Env9/Envelope #9: "<>setpagedevice" +*PageRegion Env11/Envelope #11: "<>setpagedevice" +*PageRegion Env12/Envelope #12: "<>setpagedevice" +*PageRegion Env14/Envelope #14: "<>setpagedevice" +*PageRegion EnvC65/Envelope C65: "<>setpagedevice" +*PageRegion EnvChou4/Envelope Choukei 4: "<>setpagedevice" +*PageRegion EnvISOB5/Envelope B5: "<>setpagedevice" +*PageRegion EnvISOB6/Envelope B6: "<>setpagedevice" +*PageRegion EnvKaku3/Envelope Kaku3: "<>setpagedevice" +*PageRegion EnvMonarch/Envelope Monarch: "<>setpagedevice" +*PageRegion EnvPersonal/Envelope Personal: "<>setpagedevice" +*PageRegion EnvPRC1/Envelope PRC1: "<>setpagedevice" +*PageRegion EnvPRC2/Envelope PRC2: "<>setpagedevice" +*PageRegion EnvPRC3/Envelope PRC3: "<>setpagedevice" +*PageRegion EnvPRC4/Envelope PRC4: "<>setpagedevice" +*PageRegion EnvPRC5/Envelope PRC5PRC5: "<>setpagedevice" +*PageRegion EnvPRC6/Envelope PRC6: "<>setpagedevice" +*PageRegion EnvPRC7/Envelope PRC7: "<>setpagedevice" +*PageRegion EnvPRC8/Envelope PRC8: "<>setpagedevice" +*PageRegion EnvYou4/Envelope You4: "<>setpagedevice" +*PageRegion FanFoldGerman/European Fanfold: "<>setpagedevice" +*PageRegion FanFoldGermanLegal/European Fanfold Legal: "<>setpagedevice" +*PageRegion ISOB5/B5: "<>setpagedevice" +*PageRegion ISOB5Extra/B5 Oversize: "<>setpagedevice" +*PageRegion ISOB6/B6: "<>setpagedevice" +*PageRegion ISOB7/B7: "<>setpagedevice" +*PageRegion LetterPlus/US Letter Oversize: "<>setpagedevice" +*PageRegion Note/Note: "<>setpagedevice" +*PageRegion Postcard/Postcard: "<>setpagedevice" +*PageRegion PRC16K/PRC16K: "<>setpagedevice" +*PageRegion PRC32K/PRC32K: "<>setpagedevice" +*PageRegion PRC32KBig/PRC32K Oversize: "<>setpagedevice" +*PageRegion Quarto/Quarto: "<>setpagedevice" +*PageRegion Statement/Statement: "<>setpagedevice" +*CloseUI: *PageRegion +*DefaultImageableArea: A4 +*ImageableArea A4/A4: "0 0 595 842" +*ImageableArea A5/A5: "0 0 420 595" +*ImageableArea A6/A6: "0 0 297 420" +*ImageableArea B6/JIS B6: "0 0 363 516" +*ImageableArea C6/Envelope C6: "0 0 323 459" +*ImageableArea EnvC5/Envelope C5: "0 0 459 649" +*ImageableArea EnvC6/Envelope C6: "0 0 323 459" +*ImageableArea EnvChou3/Envelope Choukei 3: "0 0 340 666" +*ImageableArea EnvDL/Envelope DL: "0 0 312 624" +*ImageableArea Env10/Envelope #10: "0 0 297 684" +*ImageableArea EnvItalian/Envelope Italian: "0 0 312 652" +*ImageableArea Executive/Executive: "0 0 522 756" +*ImageableArea Folio/Folio: "0 0 595 935" +*ImageableArea Legal/US Legal: "0 0 612 1008" +*ImageableArea Letter/US Letter: "0 0 612 792" +*ImageableArea SISG5/SIS G5: "0 0 479.055145263672 677.480346679688" +*ImageableArea SISE5/SIS E5: "0 0 325.984252929688 623.6220703125" +*ImageableArea SAC16K/SAC 16K: "0 0 532.913391113281 737.007873535156" +*ImageableArea SAC32K/SAC 32K: "0 0 368.503936767578 521.574829101562" +*ImageableArea 7x9/7 x 9: "0 0 504 648" +*ImageableArea 8x10/8 x 10: "0 0 576 720" +*ImageableArea A4Small/A4 Small: "0 0 595 842" +*ImageableArea A4Plus/A4 Oversize: "0 0 595 936" +*ImageableArea A5Extra/A5 Oversize: "0 0 492 668" +*ImageableArea B5/JIS B5: "0 0 516 729" +*ImageableArea B7/JIS B7: "0 0 258 363" +*ImageableArea DoublePostcard/Postcard Double: "0 0 567 420" +*ImageableArea Env9/Envelope #9: "0 0 279 639" +*ImageableArea Env11/Envelope #11: "0 0 324 747" +*ImageableArea Env12/Envelope #12: "0 0 342 792" +*ImageableArea Env14/Envelope #14: "0 0 360 828" +*ImageableArea EnvC65/Envelope C65: "0 0 324 648" +*ImageableArea EnvChou4/Envelope Choukei 4: "0 0 255 581" +*ImageableArea EnvISOB5/Envelope B5: "0 0 499 709" +*ImageableArea EnvISOB6/Envelope B6: "0 0 499 354" +*ImageableArea EnvKaku3/Envelope Kaku3: "0 0 612 785" +*ImageableArea EnvMonarch/Envelope Monarch: "0 0 279 540" +*ImageableArea EnvPersonal/Envelope Personal: "0 0 261 468" +*ImageableArea EnvPRC1/Envelope PRC1: "0 0 289 468" +*ImageableArea EnvPRC2/Envelope PRC2: "0 0 289 499" +*ImageableArea EnvPRC3/Envelope PRC3: "0 0 354 499" +*ImageableArea EnvPRC4/Envelope PRC4: "0 0 312 590" +*ImageableArea EnvPRC5/Envelope PRC5PRC5: "0 0 312 624" +*ImageableArea EnvPRC6/Envelope PRC6: "0 0 340 652" +*ImageableArea EnvPRC7/Envelope PRC7: "0 0 454 652" +*ImageableArea EnvPRC8/Envelope PRC8: "0 0 340 876" +*ImageableArea EnvYou4/Envelope You4: "0 0 298 666" +*ImageableArea FanFoldGerman/European Fanfold: "0 0 612 864" +*ImageableArea FanFoldGermanLegal/European Fanfold Legal: "0 0 612 936" +*ImageableArea ISOB5/B5: "0 0 499 709" +*ImageableArea ISOB5Extra/B5 Oversize: "0 0 570 782" +*ImageableArea ISOB6/B6: "0 0 354 499" +*ImageableArea ISOB7/B7: "0 0 249 354" +*ImageableArea LetterPlus/US Letter Oversize: "0 0 612 914" +*ImageableArea Note/Note: "0 0 612 792" +*ImageableArea Postcard/Postcard: "0 0 284 419" +*ImageableArea PRC16K/PRC16K: "0 0 414 610" +*ImageableArea PRC32K/PRC32K: "0 0 275 428" +*ImageableArea PRC32KBig/PRC32K Oversize: "0 0 275 428" +*ImageableArea Quarto/Quarto: "0 0 610 780" +*ImageableArea Statement/Statement: "0 0 396 612" +*DefaultPaperDimension: A4 +*PaperDimension A4/A4: "595 842" +*PaperDimension A5/A5: "420 595" +*PaperDimension A6/A6: "297 420" +*PaperDimension B6/JIS B6: "363 516" +*PaperDimension C6/Envelope C6: "323 459" +*PaperDimension EnvC5/Envelope C5: "459 649" +*PaperDimension EnvC6/Envelope C6: "323 459" +*PaperDimension EnvChou3/Envelope Choukei 3: "340 666" +*PaperDimension EnvDL/Envelope DL: "312 624" +*PaperDimension Env10/Envelope #10: "297 684" +*PaperDimension EnvItalian/Envelope Italian: "312 652" +*PaperDimension Executive/Executive: "522 756" +*PaperDimension Folio/Folio: "595 935" +*PaperDimension Legal/US Legal: "612 1008" +*PaperDimension Letter/US Letter: "612 792" +*PaperDimension SISG5/SIS G5: "479.055145263672 677.480346679688" +*PaperDimension SISE5/SIS E5: "325.984252929688 623.6220703125" +*PaperDimension SAC16K/SAC 16K: "532.913391113281 737.007873535156" +*PaperDimension SAC32K/SAC 32K: "368.503936767578 521.574829101562" +*PaperDimension 7x9/7 x 9: "504 648" +*PaperDimension 8x10/8 x 10: "576 720" +*PaperDimension A4Small/A4 Small: "595 842" +*PaperDimension A4Plus/A4 Oversize: "595 936" +*PaperDimension A5Extra/A5 Oversize: "492 668" +*PaperDimension B5/JIS B5: "516 729" +*PaperDimension B7/JIS B7: "258 363" +*PaperDimension DoublePostcard/Postcard Double: "567 420" +*PaperDimension Env9/Envelope #9: "279 639" +*PaperDimension Env11/Envelope #11: "324 747" +*PaperDimension Env12/Envelope #12: "342 792" +*PaperDimension Env14/Envelope #14: "360 828" +*PaperDimension EnvC65/Envelope C65: "324 648" +*PaperDimension EnvChou4/Envelope Choukei 4: "255 581" +*PaperDimension EnvISOB5/Envelope B5: "499 709" +*PaperDimension EnvISOB6/Envelope B6: "499 354" +*PaperDimension EnvKaku3/Envelope Kaku3: "612 785" +*PaperDimension EnvMonarch/Envelope Monarch: "279 540" +*PaperDimension EnvPersonal/Envelope Personal: "261 468" +*PaperDimension EnvPRC1/Envelope PRC1: "289 468" +*PaperDimension EnvPRC2/Envelope PRC2: "289 499" +*PaperDimension EnvPRC3/Envelope PRC3: "354 499" +*PaperDimension EnvPRC4/Envelope PRC4: "312 590" +*PaperDimension EnvPRC5/Envelope PRC5PRC5: "312 624" +*PaperDimension EnvPRC6/Envelope PRC6: "340 652" +*PaperDimension EnvPRC7/Envelope PRC7: "454 652" +*PaperDimension EnvPRC8/Envelope PRC8: "340 876" +*PaperDimension EnvYou4/Envelope You4: "298 666" +*PaperDimension FanFoldGerman/European Fanfold: "612 864" +*PaperDimension FanFoldGermanLegal/European Fanfold Legal: "612 936" +*PaperDimension ISOB5/B5: "499 709" +*PaperDimension ISOB5Extra/B5 Oversize: "570 782" +*PaperDimension ISOB6/B6: "354 499" +*PaperDimension ISOB7/B7: "249 354" +*PaperDimension LetterPlus/US Letter Oversize: "612 914" +*PaperDimension Note/Note: "612 792" +*PaperDimension Postcard/Postcard: "284 419" +*PaperDimension PRC16K/PRC16K: "414 610" +*PaperDimension PRC32K/PRC32K: "275 428" +*PaperDimension PRC32KBig/PRC32K Oversize: "275 428" +*PaperDimension Quarto/Quarto: "610 780" +*PaperDimension Statement/Statement: "396 612" +*MaxMediaWidth: "612" +*MaxMediaHeight: "1008.000061035156" +*HWMargins: 14.173229217529 14.173229217529 14.173229217529 14.173229217529 +*CustomPageSize True: "pop pop pop <>setpagedevice" +*ParamCustomPageSize Width: 1 points 212.598434448242 612 +*ParamCustomPageSize Height: 2 points 297.637817382812 1008.000061035156 +*ParamCustomPageSize WidthOffset: 3 points 0 0 +*ParamCustomPageSize HeightOffset: 4 points 0 0 +*ParamCustomPageSize Orientation: 5 int 0 0 +*OpenUI *ColorModel/Color Mode: PickOne +*OrderDependency: 10 AnySetup *ColorModel +*DefaultColorModel: Gray +*ColorModel Gray/Grayscale: "<>setpagedevice" +*CloseUI: *ColorModel +*OpenUI *Resolution/Resolution: PickOne +*OrderDependency: 10 AnySetup *Resolution +*DefaultResolution: 600dpi +*Resolution 600dpi/600 DPI: "<>setpagedevice" +*CloseUI: *Resolution +*OpenUI *MediaType/Media Type: PickOne +*OrderDependency: 10 AnySetup *MediaType +*DefaultMediaType: Plain +*MediaType Plain/Plain Paper: "<>setpagedevice" +*CloseUI: *MediaType +*DefaultFont: Courier +*Font AvantGarde-Book: Standard "(1.05)" Standard ROM +*Font AvantGarde-BookOblique: Standard "(1.05)" Standard ROM +*Font AvantGarde-Demi: Standard "(1.05)" Standard ROM +*Font AvantGarde-DemiOblique: Standard "(1.05)" Standard ROM +*Font Bookman-Demi: Standard "(1.05)" Standard ROM +*Font Bookman-DemiItalic: Standard "(1.05)" Standard ROM +*Font Bookman-Light: Standard "(1.05)" Standard ROM +*Font Bookman-LightItalic: Standard "(1.05)" Standard ROM +*Font Courier: Standard "(1.05)" Standard ROM +*Font Courier-Bold: Standard "(1.05)" Standard ROM +*Font Courier-BoldOblique: Standard "(1.05)" Standard ROM +*Font Courier-Oblique: Standard "(1.05)" Standard ROM +*Font Helvetica: Standard "(1.05)" Standard ROM +*Font Helvetica-Bold: Standard "(1.05)" Standard ROM +*Font Helvetica-BoldOblique: Standard "(1.05)" Standard ROM +*Font Helvetica-Narrow: Standard "(1.05)" Standard ROM +*Font Helvetica-Narrow-Bold: Standard "(1.05)" Standard ROM +*Font Helvetica-Narrow-BoldOblique: Standard "(1.05)" Standard ROM +*Font Helvetica-Narrow-Oblique: Standard "(1.05)" Standard ROM +*Font Helvetica-Oblique: Standard "(1.05)" Standard ROM +*Font NewCenturySchlbk-Bold: Standard "(1.05)" Standard ROM +*Font NewCenturySchlbk-BoldItalic: Standard "(1.05)" Standard ROM +*Font NewCenturySchlbk-Italic: Standard "(1.05)" Standard ROM +*Font NewCenturySchlbk-Roman: Standard "(1.05)" Standard ROM +*Font Palatino-Bold: Standard "(1.05)" Standard ROM +*Font Palatino-BoldItalic: Standard "(1.05)" Standard ROM +*Font Palatino-Italic: Standard "(1.05)" Standard ROM +*Font Palatino-Roman: Standard "(1.05)" Standard ROM +*Font Symbol: Special "(001.005)" Special ROM +*Font Times-Bold: Standard "(1.05)" Standard ROM +*Font Times-BoldItalic: Standard "(1.05)" Standard ROM +*Font Times-Italic: Standard "(1.05)" Standard ROM +*Font Times-Roman: Standard "(1.05)" Standard ROM +*Font ZapfChancery-MediumItalic: Standard "(1.05)" Standard ROM +*Font ZapfDingbats: Special "(001.005)" Special ROM +*% End of CNLB3K.ppd, 20690 bytes. diff --git a/configure.ac b/configure.ac index d9b011d..5bee458 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ([2.69]) -AC_INIT([captdriver], [0.1.0]) +AC_INIT([captdriver], [0.1.2]) AC_CONFIG_SRCDIR([src/std.h]) diff --git a/src/canon-lbp.drv b/src/canon-lbp.drv new file mode 100644 index 0000000..15d7571 --- /dev/null +++ b/src/canon-lbp.drv @@ -0,0 +1,126 @@ +/* + * Canon CAPT LBP Printers + * captdriver PPD Source File + * for use with CUPS ppdc to generate PPDs + * + */ +#include +#include + +#media "SISG5/SIS G5" 169mm 239mm +#media "SISE5/SIS E5" 115mm 220mm +#media "SAC16K/SAC 16K" 188mm 260mm +#media "SAC32K/SAC 32K" 130mm 184mm + +Copyright "(C)2020 Moses Chong" +ColorModel "Gray/Grayscale" k chunky 2 +Filter application/vnd.cups-raster 1 rastertocapt +*Manufacturer "Canon Inc" +Version 0.1.2 +{ + Font * + + // Common Sizes + *MediaSize A4 + MediaSize A5 + MediaSize A6 + MediaSize B6 + MediaSize C6 + MediaSize EnvC5 + MediaSize EnvC6 + MediaSize EnvChou3 + MediaSize EnvDL + MediaSize Env10 + MediaSize EnvItalian + MediaSize Executive // US 7.25x10.5 inch + MediaSize Folio // SE Asian F4 + MediaSize Legal + MediaSize Letter + MediaSize SISG5 + MediaSize SISE5 + MediaSize SAC16K + MediaSize SAC32K + + // Less Common Sizes + /* + * Sizes A6 and larger, and no wider than US Legal have + * been included here. + * + * PROTIP: Delete this section and recompile PPD, for a + * less cluttered Paper Size menu in most applications, + * if you don't use these sizes. If you use any of them, + * move the sizes you need from below to the section above, + * then delete the rest. + * + * NOTE: Some of the sizes appear to be identical to + * another at least in terms of width and length. There + * could be other differences, and may be useful in managing + * multiple trays on printers that support them. + * + */ + MediaSize 7x9 + MediaSize 8x10 + MediaSize A4Small // Same dimensions as A4 + MediaSize A4Plus // Longer than Folio (F4) by just one point + MediaSize A5Extra + MediaSize B5 + MediaSize B7 + MediaSize DoublePostcard + MediaSize Env9 + MediaSize Env11 + MediaSize Env12 + MediaSize Env14 + MediaSize EnvC65 + MediaSize EnvChou4 + MediaSize EnvISOB5 + MediaSize EnvISOB6 + MediaSize EnvKaku3 + MediaSize EnvMonarch + MediaSize EnvPersonal + MediaSize EnvPRC1 + MediaSize EnvPRC2 + MediaSize EnvPRC3 + MediaSize EnvPRC4 + MediaSize EnvPRC5 + MediaSize EnvPRC6 + MediaSize EnvPRC7 + MediaSize EnvPRC8 + MediaSize EnvYou4 + MediaSize FanFoldGerman + MediaSize FanFoldGermanLegal + MediaSize ISOB5 + MediaSize ISOB5Extra + MediaSize ISOB6 + MediaSize ISOB7 + MediaSize LetterPlus + MediaSize Note // Same dimensions as Letter (US) + MediaSize Postcard + MediaSize PRC16K + MediaSize PRC32K + MediaSize PRC32KBig + MediaSize Quarto + MediaSize Statement + // End Less Common Sizes + + *Resolution k 1 70 592 0 "600dpi/600 DPI" + MaxSize 215.9mm 355.6mm // US Legal + VariablePaperSize yes + { + // nearly matched to Alexey Galakhov's original 2011 specs + *ModelName "LBP2900/LBP3010 r2c" + FileName "Canon-LBP2900.ppd" + MinSize 75mm 105mm + HWmargins 4.7095835mm 4.7095835mm 4.709583mm 4.709583mm + PCFileName "CNLB2K9.ppd" + } + + { + *ModelName "LBP3000 r2c" + FileName "Canon-LBP3000.ppd" + HWmargins 5mm 5mm 5mm 5mm + MinSize 75mm 105mm + MediaType 1 "Plain/Plain Paper" + PCFileName "CNLB3K.ppd" + } +} + diff --git a/src/paper.c b/src/paper.c index a89650b..18b1cab 100644 --- a/src/paper.c +++ b/src/paper.c @@ -25,4 +25,6 @@ void page_set_dims(struct page_dims_s *dims, const struct cups_page_header2_s *h { dims->paper_width = header->PageSize[0] * header->HWResolution[0] / 72; dims->paper_height = header->PageSize[1] * header->HWResolution[1] / 72; + dims->margin_height = header->Margins[0]; + dims->margin_width = header->Margins[1]; } diff --git a/src/paper.h b/src/paper.h index be6d2d4..70eaba0 100644 --- a/src/paper.h +++ b/src/paper.h @@ -24,9 +24,11 @@ struct cups_page_header2_s; struct page_dims_s { - /* set by */ + /* set by CUPS */ unsigned paper_width; unsigned paper_height; + unsigned margin_height; + unsigned margin_width; /* set by printer ops */ unsigned line_size; unsigned band_size; diff --git a/src/prn_lbp2900.c b/src/prn_lbp2900.c index 6835623..7661374 100644 --- a/src/prn_lbp2900.c +++ b/src/prn_lbp2900.c @@ -125,13 +125,18 @@ static void lbp2900_job_prologue(struct printer_state_s *state) static void lbp3000_job_prologue(struct printer_state_s *state) { (void) state; + uint8_t buf[8]; + size_t size; + capt_sendrecv(CAPT_IDENT, NULL, 0, NULL, 0); sleep(1); capt_init_status(); lbp2900_get_status(state->ops); capt_sendrecv(CAPT_START_0, NULL, 0, NULL, 0); - capt_sendrecv(CAPT_JOB_BEGIN, magicbuf_0, ARRAY_SIZE(magicbuf_0), NULL, 0); + capt_sendrecv(CAPT_JOB_BEGIN, magicbuf_0, ARRAY_SIZE(magicbuf_0), buf, &size); + job=WORD(buf[2], buf[3]); + /* LBP-3000 prints the very first printjob perfectly * and then proceeds to hang at this (commented out) * spot. That's the difference, or so it seems. */ @@ -157,23 +162,23 @@ static bool lbp2900_page_prologue(struct printer_state_s *state, const struct pa uint8_t pt2 = 0x01; uint8_t pageparms[] = { + /* Bytes 0-21 (0x00 to 0x15) */ 0x00, 0x00, 0x30, 0x2A, /* sz */ 0x02, 0x00, 0x00, 0x00, 0x1C, 0x1C, 0x1C, 0x1C, pt1, /* adapt */ 0x11, 0x04, 0x00, 0x01, 0x01, /* img ref */ 0x00, save, 0x00, 0x00, - /* height margin 118 */ 0x76, 0x00, - /* width margin 78 */ 0x4e, 0x00, - LO(dims->line_size), HI(dims->line_size), LO(dims->num_lines), HI(dims->num_lines), + /* Bytes 22-33 (0x16 to 0x21) */ + LO(dims->margin_height), HI(dims->margin_height), + LO(dims->margin_width), HI(dims->margin_width), + LO(dims->line_size), HI(dims->line_size), + LO(dims->num_lines), HI(dims->num_lines), LO(dims->paper_width), HI(dims->paper_width), LO(dims->paper_height), HI(dims->paper_height), - /* 34 bytes */ + /* Bytes 34-39 (0x22 to 0x27) */ 0x00, 0x00, pt2, 0x00, 0x00, 0x00, - /* 72 bytes */ -/* + /* Spare bytes for later 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -*/ + */ }; (void) state; @@ -266,22 +271,15 @@ static void lbp2900_job_epilogue(struct printer_state_s *state) static void lbp2900_page_setup(struct printer_state_s *state, struct page_dims_s *dims, unsigned width, unsigned height) -{ -/* - A4 4736x6778 or 4736x4520 - Letter 4864x6368 - Legal 4864x8192 - Executive 4128x6080 - 3x5 1344x2528 -*/ +{ + // FIXME: Do we still need this function? (void) state; (void) width; + (void) height; + // Get raster dimensions straight from CUPS in paper.c + dims->num_lines = dims->paper_height; + dims->line_size = dims->paper_width / 8; dims->band_size = 70; - dims->line_size = 4736 / 8; - if (height > 6778) - dims->num_lines = 6778; - else - dims->num_lines = height; } static void lbp2900_wait_user(struct printer_state_s *state) From 7384729ce4903598f856435968488bfd4ef5b09c Mon Sep 17 00:00:00 2001 From: mounaiban <29518031+mounaiban@users.noreply.github.com> Date: Wed, 27 Jun 2018 14:12:15 +1000 Subject: [PATCH 2/6] Toner save and paper type controls from CUPS --- Canon-LBP2900.ppd | 21 ++++++++++++++++++++- Canon-LBP3000.ppd | 18 ++++++++++++++++-- configure.ac | 2 +- src/canon-lbp.drv | 27 +++++++++++++++++++++++++-- src/paper.c | 5 ++++- src/paper.h | 3 +++ src/prn_lbp2900.c | 8 +++++--- 7 files changed, 74 insertions(+), 10 deletions(-) diff --git a/Canon-LBP2900.ppd b/Canon-LBP2900.ppd index a42e1f5..bc7ddcb 100644 --- a/Canon-LBP2900.ppd +++ b/Canon-LBP2900.ppd @@ -293,11 +293,30 @@ *DefaultColorModel: Gray *ColorModel Gray/Grayscale: "<>setpagedevice" *CloseUI: *ColorModel +*OpenUI *captMediaWeight/Media Type B (Experimental): PickOne +*OrderDependency: 11 AnySetup *captMediaWeight +*DefaultcaptMediaWeight: pt2-1 +*captMediaWeight pt2-0/0: "<>setpagedevice" +*captMediaWeight pt2-1/Default: "<>setpagedevice" +*captMediaWeight pt2-2/2: "<>setpagedevice" +*CloseUI: *captMediaWeight +*OpenUI *captTonerSave/Toner Save: Boolean +*OrderDependency: 10 AnySetup *captTonerSave +*DefaultcaptTonerSave: False +*captTonerSave False/Disabled: "<>setpagedevice" +*captTonerSave True/Enabled: "<>setpagedevice" +*CloseUI: *captTonerSave *OpenUI *Resolution/Resolution: PickOne *OrderDependency: 10 AnySetup *Resolution *DefaultResolution: 600dpi *Resolution 600dpi/600 DPI: "<>setpagedevice" *CloseUI: *Resolution +*OpenUI *MediaType/Media Type: PickOne +*OrderDependency: 10 AnySetup *MediaType +*DefaultMediaType: Plain +*MediaType Plain/Plain Paper: "<>setpagedevice" +*MediaType Thick/Thick Paper: "<>setpagedevice" +*CloseUI: *MediaType *DefaultFont: Courier *Font AvantGarde-Book: Standard "(1.05)" Standard ROM *Font AvantGarde-BookOblique: Standard "(1.05)" Standard ROM @@ -334,4 +353,4 @@ *Font Times-Roman: Standard "(1.05)" Standard ROM *Font ZapfChancery-MediumItalic: Standard "(1.05)" Standard ROM *Font ZapfDingbats: Special "(001.005)" Special ROM -*% End of CNLB2K9.ppd, 20521 bytes. +*% End of CNLB2K9.ppd, 21444 bytes. diff --git a/Canon-LBP3000.ppd b/Canon-LBP3000.ppd index 5f1341f..9deaed8 100644 --- a/Canon-LBP3000.ppd +++ b/Canon-LBP3000.ppd @@ -293,6 +293,19 @@ *DefaultColorModel: Gray *ColorModel Gray/Grayscale: "<>setpagedevice" *CloseUI: *ColorModel +*OpenUI *captMediaWeight/Media Type B (Experimental): PickOne +*OrderDependency: 11 AnySetup *captMediaWeight +*DefaultcaptMediaWeight: pt2-1 +*captMediaWeight pt2-0/0: "<>setpagedevice" +*captMediaWeight pt2-1/Default: "<>setpagedevice" +*captMediaWeight pt2-2/2: "<>setpagedevice" +*CloseUI: *captMediaWeight +*OpenUI *captTonerSave/Toner Save: Boolean +*OrderDependency: 10 AnySetup *captTonerSave +*DefaultcaptTonerSave: False +*captTonerSave False/Disabled: "<>setpagedevice" +*captTonerSave True/Enabled: "<>setpagedevice" +*CloseUI: *captTonerSave *OpenUI *Resolution/Resolution: PickOne *OrderDependency: 10 AnySetup *Resolution *DefaultResolution: 600dpi @@ -301,7 +314,8 @@ *OpenUI *MediaType/Media Type: PickOne *OrderDependency: 10 AnySetup *MediaType *DefaultMediaType: Plain -*MediaType Plain/Plain Paper: "<>setpagedevice" +*MediaType Plain/Plain Paper: "<>setpagedevice" +*MediaType Thick/Thick Paper: "<>setpagedevice" *CloseUI: *MediaType *DefaultFont: Courier *Font AvantGarde-Book: Standard "(1.05)" Standard ROM @@ -339,4 +353,4 @@ *Font Times-Roman: Standard "(1.05)" Standard ROM *Font ZapfChancery-MediumItalic: Standard "(1.05)" Standard ROM *Font ZapfDingbats: Special "(001.005)" Special ROM -*% End of CNLB3K.ppd, 20690 bytes. +*% End of CNLB3K.ppd, 21404 bytes. diff --git a/configure.ac b/configure.ac index 5bee458..cfacf3d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ([2.69]) -AC_INIT([captdriver], [0.1.2]) +AC_INIT([captdriver], [0.1.3]) AC_CONFIG_SRCDIR([src/std.h]) diff --git a/src/canon-lbp.drv b/src/canon-lbp.drv index 15d7571..b96f1d0 100644 --- a/src/canon-lbp.drv +++ b/src/canon-lbp.drv @@ -16,7 +16,7 @@ Copyright "(C)2020 Moses Chong" ColorModel "Gray/Grayscale" k chunky 2 Filter application/vnd.cups-raster 1 rastertocapt *Manufacturer "Canon Inc" -Version 0.1.2 +Version 0.1.3 { Font * @@ -102,8 +102,32 @@ Version 0.1.2 MediaSize Statement // End Less Common Sizes + // Paper Type B Options + /* + This option is wired directly to the pt2 register in the + page prologue (see prn_lbp2900.c). Its exact purpose is not + known, but it appears to be an adjustment to cater the printer + for different paper weights. + The proprietary drivers offers a 'Plain Paper L' and 'Heavy Paper H' + option. The LBP 3000 manual describes Heavy Paper H as an option + to 'get improved fixing properties' for thick paper and + Plain Paper L as an option reduce curling on plain paper. + And then there's the Transparency option for clear plastic film... + */ + Option "captMediaWeight/Media Type B (Experimental)" PickOne AnySetup 11 + Choice "pt2-0/0" "<>setpagedevice" + *Choice "pt2-1/Default" "<>setpagedevice" + Choice "pt2-2/2" "<>setpagedevice" + + // Toner Save Option + Option "captTonerSave/Toner Save" Boolean AnySetup 10 + *Choice False/Disabled "<>setpagedevice" + Choice True/Enabled "<>setpagedevice" + *Resolution k 1 70 592 0 "600dpi/600 DPI" MaxSize 215.9mm 355.6mm // US Legal + MediaType 0 "Plain/Plain Paper" + MediaType 1 "Thick/Thick Paper" VariablePaperSize yes { // nearly matched to Alexey Galakhov's original 2011 specs @@ -119,7 +143,6 @@ Version 0.1.2 FileName "Canon-LBP3000.ppd" HWmargins 5mm 5mm 5mm 5mm MinSize 75mm 105mm - MediaType 1 "Plain/Plain Paper" PCFileName "CNLB3K.ppd" } } diff --git a/src/paper.c b/src/paper.c index 18b1cab..8f3a51f 100644 --- a/src/paper.c +++ b/src/paper.c @@ -18,13 +18,16 @@ */ #include "paper.h" - #include void page_set_dims(struct page_dims_s *dims, const struct cups_page_header2_s *header) { + dims->media_type_a = header->cupsMediaType; + dims->media_type_b = header->MediaWeight; dims->paper_width = header->PageSize[0] * header->HWResolution[0] / 72; dims->paper_height = header->PageSize[1] * header->HWResolution[1] / 72; + //using cupsCompression to reduce ink darkness, like Zebra printers + dims->toner_save = header->cupsCompression; dims->margin_height = header->Margins[0]; dims->margin_width = header->Margins[1]; } diff --git a/src/paper.h b/src/paper.h index 70eaba0..a072e1a 100644 --- a/src/paper.h +++ b/src/paper.h @@ -25,8 +25,11 @@ struct cups_page_header2_s; struct page_dims_s { /* set by CUPS */ + unsigned media_type_a; + unsigned media_type_b; unsigned paper_width; unsigned paper_height; + unsigned toner_save; unsigned margin_height; unsigned margin_width; /* set by printer ops */ diff --git a/src/prn_lbp2900.c b/src/prn_lbp2900.c index 7661374..9972077 100644 --- a/src/prn_lbp2900.c +++ b/src/prn_lbp2900.c @@ -157,9 +157,11 @@ static bool lbp2900_page_prologue(struct printer_state_s *state, const struct pa size_t s; uint8_t buf[16]; - uint8_t pt1 = 0x01; - uint8_t save = 0x00; - uint8_t pt2 = 0x01; + uint8_t pt1 = dims->media_type_a; + uint8_t save = dims->toner_save; + uint8_t pt2 = dims->media_type_b; // Please see .drv file + + fprintf(stderr, "DEBUG: CAPT: Media type: pt1=%u, pt2=%u\n", pt1, pt2); uint8_t pageparms[] = { /* Bytes 0-21 (0x00 to 0x15) */ From 0b71004238738e63d4b9bdbccadda8ef26df9138 Mon Sep 17 00:00:00 2001 From: mounaiban <29518031+mounaiban@users.noreply.github.com> Date: Mon, 6 Apr 2020 23:32:59 +1000 Subject: [PATCH 3/6] Add support for all media types All four media types supported by the proprietary drivers have been implemented --- Canon-LBP2900.ppd | 19 ++++++++----------- Canon-LBP3000.ppd | 19 ++++++++----------- src/canon-lbp.drv | 23 +++++------------------ src/paper.c | 8 +++++--- src/paper.h | 3 +-- src/prn_lbp2900.c | 39 ++++++++++++++++++++++++++++++++------- 6 files changed, 59 insertions(+), 52 deletions(-) diff --git a/Canon-LBP2900.ppd b/Canon-LBP2900.ppd index bc7ddcb..b57a82b 100644 --- a/Canon-LBP2900.ppd +++ b/Canon-LBP2900.ppd @@ -3,7 +3,7 @@ *%%%% Created by the CUPS PPD Compiler CUPS v2.2.10. *% (C)2020 Moses Chong *FormatVersion: "4.3" -*FileVersion: "0.1.2" +*FileVersion: "0.1.3" *LanguageVersion: English *LanguageEncoding: ISOLatin1 *PCFileName: "CNLB2K9.ppd" @@ -11,7 +11,7 @@ *Manufacturer: "Canon Inc" *ModelName: "Canon Inc LBP2900/LBP3010 r2c" *ShortNickName: "Canon Inc LBP2900/LBP3010 r2c" -*NickName: "Canon Inc LBP2900/LBP3010 r2c, 0.1.2" +*NickName: "Canon Inc LBP2900/LBP3010 r2c, 0.1.3" *PSVersion: "(3010.000) 0" *LanguageLevel: "3" *ColorDevice: False @@ -293,13 +293,6 @@ *DefaultColorModel: Gray *ColorModel Gray/Grayscale: "<>setpagedevice" *CloseUI: *ColorModel -*OpenUI *captMediaWeight/Media Type B (Experimental): PickOne -*OrderDependency: 11 AnySetup *captMediaWeight -*DefaultcaptMediaWeight: pt2-1 -*captMediaWeight pt2-0/0: "<>setpagedevice" -*captMediaWeight pt2-1/Default: "<>setpagedevice" -*captMediaWeight pt2-2/2: "<>setpagedevice" -*CloseUI: *captMediaWeight *OpenUI *captTonerSave/Toner Save: Boolean *OrderDependency: 10 AnySetup *captTonerSave *DefaultcaptTonerSave: False @@ -315,7 +308,11 @@ *OrderDependency: 10 AnySetup *MediaType *DefaultMediaType: Plain *MediaType Plain/Plain Paper: "<>setpagedevice" -*MediaType Thick/Thick Paper: "<>setpagedevice" +*MediaType Heavy/Heavy Paper: "<>setpagedevice" +*MediaType PlainL/Plain Paper L: "<>setpagedevice" +*MediaType HeavyH/Heavy Paper H: "<>setpagedevice" +*MediaType Transparency/Transparency: "<>setpagedevice" +*MediaType Envelope/Envelope: "<>setpagedevice" *CloseUI: *MediaType *DefaultFont: Courier *Font AvantGarde-Book: Standard "(1.05)" Standard ROM @@ -353,4 +350,4 @@ *Font Times-Roman: Standard "(1.05)" Standard ROM *Font ZapfChancery-MediumItalic: Standard "(1.05)" Standard ROM *Font ZapfDingbats: Special "(001.005)" Special ROM -*% End of CNLB2K9.ppd, 21444 bytes. +*% End of CNLB2K9.ppd, 21449 bytes. diff --git a/Canon-LBP3000.ppd b/Canon-LBP3000.ppd index 9deaed8..3d2a7f1 100644 --- a/Canon-LBP3000.ppd +++ b/Canon-LBP3000.ppd @@ -3,7 +3,7 @@ *%%%% Created by the CUPS PPD Compiler CUPS v2.2.10. *% (C)2020 Moses Chong *FormatVersion: "4.3" -*FileVersion: "0.1.2" +*FileVersion: "0.1.3" *LanguageVersion: English *LanguageEncoding: ISOLatin1 *PCFileName: "CNLB3K.ppd" @@ -11,7 +11,7 @@ *Manufacturer: "Canon Inc" *ModelName: "Canon Inc LBP3000 r2c" *ShortNickName: "Canon Inc LBP3000 r2c" -*NickName: "Canon Inc LBP3000 r2c, 0.1.2" +*NickName: "Canon Inc LBP3000 r2c, 0.1.3" *PSVersion: "(3010.000) 0" *LanguageLevel: "3" *ColorDevice: False @@ -293,13 +293,6 @@ *DefaultColorModel: Gray *ColorModel Gray/Grayscale: "<>setpagedevice" *CloseUI: *ColorModel -*OpenUI *captMediaWeight/Media Type B (Experimental): PickOne -*OrderDependency: 11 AnySetup *captMediaWeight -*DefaultcaptMediaWeight: pt2-1 -*captMediaWeight pt2-0/0: "<>setpagedevice" -*captMediaWeight pt2-1/Default: "<>setpagedevice" -*captMediaWeight pt2-2/2: "<>setpagedevice" -*CloseUI: *captMediaWeight *OpenUI *captTonerSave/Toner Save: Boolean *OrderDependency: 10 AnySetup *captTonerSave *DefaultcaptTonerSave: False @@ -315,7 +308,11 @@ *OrderDependency: 10 AnySetup *MediaType *DefaultMediaType: Plain *MediaType Plain/Plain Paper: "<>setpagedevice" -*MediaType Thick/Thick Paper: "<>setpagedevice" +*MediaType Heavy/Heavy Paper: "<>setpagedevice" +*MediaType PlainL/Plain Paper L: "<>setpagedevice" +*MediaType HeavyH/Heavy Paper H: "<>setpagedevice" +*MediaType Transparency/Transparency: "<>setpagedevice" +*MediaType Envelope/Envelope: "<>setpagedevice" *CloseUI: *MediaType *DefaultFont: Courier *Font AvantGarde-Book: Standard "(1.05)" Standard ROM @@ -353,4 +350,4 @@ *Font Times-Roman: Standard "(1.05)" Standard ROM *Font ZapfChancery-MediumItalic: Standard "(1.05)" Standard ROM *Font ZapfDingbats: Special "(001.005)" Special ROM -*% End of CNLB3K.ppd, 21404 bytes. +*% End of CNLB3K.ppd, 21409 bytes. diff --git a/src/canon-lbp.drv b/src/canon-lbp.drv index b96f1d0..3da6774 100644 --- a/src/canon-lbp.drv +++ b/src/canon-lbp.drv @@ -102,23 +102,6 @@ Version 0.1.3 MediaSize Statement // End Less Common Sizes - // Paper Type B Options - /* - This option is wired directly to the pt2 register in the - page prologue (see prn_lbp2900.c). Its exact purpose is not - known, but it appears to be an adjustment to cater the printer - for different paper weights. - The proprietary drivers offers a 'Plain Paper L' and 'Heavy Paper H' - option. The LBP 3000 manual describes Heavy Paper H as an option - to 'get improved fixing properties' for thick paper and - Plain Paper L as an option reduce curling on plain paper. - And then there's the Transparency option for clear plastic film... - */ - Option "captMediaWeight/Media Type B (Experimental)" PickOne AnySetup 11 - Choice "pt2-0/0" "<>setpagedevice" - *Choice "pt2-1/Default" "<>setpagedevice" - Choice "pt2-2/2" "<>setpagedevice" - // Toner Save Option Option "captTonerSave/Toner Save" Boolean AnySetup 10 *Choice False/Disabled "<>setpagedevice" @@ -127,7 +110,11 @@ Version 0.1.3 *Resolution k 1 70 592 0 "600dpi/600 DPI" MaxSize 215.9mm 355.6mm // US Legal MediaType 0 "Plain/Plain Paper" - MediaType 1 "Thick/Thick Paper" + MediaType 1 "Heavy/Heavy Paper" + MediaType 2 "PlainL/Plain Paper L" + MediaType 3 "HeavyH/Heavy Paper H" + MediaType 4 "Transparency" + MediaType 5 "Envelope" VariablePaperSize yes { // nearly matched to Alexey Galakhov's original 2011 specs diff --git a/src/paper.c b/src/paper.c index 8f3a51f..19af997 100644 --- a/src/paper.c +++ b/src/paper.c @@ -22,11 +22,13 @@ void page_set_dims(struct page_dims_s *dims, const struct cups_page_header2_s *header) { - dims->media_type_a = header->cupsMediaType; - dims->media_type_b = header->MediaWeight; + dims->media_type = header->cupsMediaType; dims->paper_width = header->PageSize[0] * header->HWResolution[0] / 72; dims->paper_height = header->PageSize[1] * header->HWResolution[1] / 72; - //using cupsCompression to reduce ink darkness, like Zebra printers + /* + The use of cupsCompression to toggle toner save was inspired by the + use of the same attribute to control darkness in label printer drivers. + */ dims->toner_save = header->cupsCompression; dims->margin_height = header->Margins[0]; dims->margin_width = header->Margins[1]; diff --git a/src/paper.h b/src/paper.h index a072e1a..435db69 100644 --- a/src/paper.h +++ b/src/paper.h @@ -25,8 +25,7 @@ struct cups_page_header2_s; struct page_dims_s { /* set by CUPS */ - unsigned media_type_a; - unsigned media_type_b; + unsigned media_type; unsigned paper_width; unsigned paper_height; unsigned toner_save; diff --git a/src/prn_lbp2900.c b/src/prn_lbp2900.c index 9972077..f82eec9 100644 --- a/src/prn_lbp2900.c +++ b/src/prn_lbp2900.c @@ -157,16 +157,41 @@ static bool lbp2900_page_prologue(struct printer_state_s *state, const struct pa size_t s; uint8_t buf[16]; - uint8_t pt1 = dims->media_type_a; uint8_t save = dims->toner_save; - uint8_t pt2 = dims->media_type_b; // Please see .drv file + uint8_t fm = 0x00; /* fuser mode (temperature?) */ - fprintf(stderr, "DEBUG: CAPT: Media type: pt1=%u, pt2=%u\n", pt1, pt2); + switch (dims->media_type) { + case 0x00: + case 0x02: + /* Plain Paper & Plain Paper L */ + fm = 0x01; + break; + case 0x01: + /* Heavy Paper */ + fm = 0x01; + break; + case 0x03: + /* Heavy Paper H */ + fm = 0x02; + break; + case 0x04: + /* Transparency */ + fm = 0x13; + break; + case 0x05: + /* Envelope */ + fm = 0x1C; + break; + default: + fm = 0x01; + } + + fprintf(stderr, "DEBUG: CAPT: media_type=%u, fm=%u\n", dims->media_type, fm); uint8_t pageparms[] = { /* Bytes 0-21 (0x00 to 0x15) */ 0x00, 0x00, 0x30, 0x2A, /* sz */ 0x02, 0x00, 0x00, 0x00, - 0x1C, 0x1C, 0x1C, 0x1C, pt1, /* adapt */ 0x11, 0x04, 0x00, + 0x1C, 0x1C, 0x1C, 0x1C, dims->media_type, /* adapt */ 0x11, 0x04, 0x00, 0x01, 0x01, /* img ref */ 0x00, save, 0x00, 0x00, /* Bytes 22-33 (0x16 to 0x21) */ LO(dims->margin_height), HI(dims->margin_height), @@ -176,7 +201,7 @@ static bool lbp2900_page_prologue(struct printer_state_s *state, const struct pa LO(dims->paper_width), HI(dims->paper_width), LO(dims->paper_height), HI(dims->paper_height), /* Bytes 34-39 (0x22 to 0x27) */ - 0x00, 0x00, pt2, 0x00, 0x00, 0x00, + 0x00, 0x00, fm, 0x00, 0x00, 0x00, /* Spare bytes for later 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -274,11 +299,11 @@ static void lbp2900_page_setup(struct printer_state_s *state, struct page_dims_s *dims, unsigned width, unsigned height) { - // FIXME: Do we still need this function? + /* FIXME: Do we still need this function? */ (void) state; (void) width; (void) height; - // Get raster dimensions straight from CUPS in paper.c + /* Get raster dimensions straight from CUPS in paper.c */ dims->num_lines = dims->paper_height; dims->line_size = dims->paper_width / 8; dims->band_size = 70; From 90d0246cc08a2836af23c8e201064e68c94be568 Mon Sep 17 00:00:00 2001 From: mounaiban <29518031+mounaiban@users.noreply.github.com> Date: Fri, 10 Apr 2020 11:36:47 +1000 Subject: [PATCH 4/6] Restore LBP2900 page setup ops This page setup ops locks page size to A4 and media type to Plain Paper for LBP2900 and 3010, but is known to work Matching ppds have been included --- Canon-LBP2900.ppd | 265 +--------------------------------------------- Canon-LBP3000.ppd | 6 +- src/canon-lbp.drv | 183 ++++++++++++++++---------------- src/prn_lbp2900.c | 29 ++++- 4 files changed, 126 insertions(+), 357 deletions(-) diff --git a/Canon-LBP2900.ppd b/Canon-LBP2900.ppd index b57a82b..140a8e7 100644 --- a/Canon-LBP2900.ppd +++ b/Canon-LBP2900.ppd @@ -3,7 +3,7 @@ *%%%% Created by the CUPS PPD Compiler CUPS v2.2.10. *% (C)2020 Moses Chong *FormatVersion: "4.3" -*FileVersion: "0.1.3" +*FileVersion: "0.1.3-emergency-fix-1" *LanguageVersion: English *LanguageEncoding: ISOLatin1 *PCFileName: "CNLB2K9.ppd" @@ -11,7 +11,7 @@ *Manufacturer: "Canon Inc" *ModelName: "Canon Inc LBP2900/LBP3010 r2c" *ShortNickName: "Canon Inc LBP2900/LBP3010 r2c" -*NickName: "Canon Inc LBP2900/LBP3010 r2c, 0.1.3" +*NickName: "Canon Inc LBP2900/LBP3010 r2c, 0.1.3-emergency-fix-1" *PSVersion: "(3010.000) 0" *LanguageLevel: "3" *ColorDevice: False @@ -29,265 +29,16 @@ *OrderDependency: 10 AnySetup *PageSize *DefaultPageSize: A4 *PageSize A4/A4: "<>setpagedevice" -*PageSize A5/A5: "<>setpagedevice" -*PageSize A6/A6: "<>setpagedevice" -*PageSize B6/JIS B6: "<>setpagedevice" -*PageSize C6/Envelope C6: "<>setpagedevice" -*PageSize EnvC5/Envelope C5: "<>setpagedevice" -*PageSize EnvC6/Envelope C6: "<>setpagedevice" -*PageSize EnvChou3/Envelope Choukei 3: "<>setpagedevice" -*PageSize EnvDL/Envelope DL: "<>setpagedevice" -*PageSize Env10/Envelope #10: "<>setpagedevice" -*PageSize EnvItalian/Envelope Italian: "<>setpagedevice" -*PageSize Executive/Executive: "<>setpagedevice" -*PageSize Folio/Folio: "<>setpagedevice" -*PageSize Legal/US Legal: "<>setpagedevice" -*PageSize Letter/US Letter: "<>setpagedevice" -*PageSize SISG5/SIS G5: "<>setpagedevice" -*PageSize SISE5/SIS E5: "<>setpagedevice" -*PageSize SAC16K/SAC 16K: "<>setpagedevice" -*PageSize SAC32K/SAC 32K: "<>setpagedevice" -*PageSize 7x9/7 x 9: "<>setpagedevice" -*PageSize 8x10/8 x 10: "<>setpagedevice" -*PageSize A4Small/A4 Small: "<>setpagedevice" -*PageSize A4Plus/A4 Oversize: "<>setpagedevice" -*PageSize A5Extra/A5 Oversize: "<>setpagedevice" -*PageSize B5/JIS B5: "<>setpagedevice" -*PageSize B7/JIS B7: "<>setpagedevice" -*PageSize DoublePostcard/Postcard Double: "<>setpagedevice" -*PageSize Env9/Envelope #9: "<>setpagedevice" -*PageSize Env11/Envelope #11: "<>setpagedevice" -*PageSize Env12/Envelope #12: "<>setpagedevice" -*PageSize Env14/Envelope #14: "<>setpagedevice" -*PageSize EnvC65/Envelope C65: "<>setpagedevice" -*PageSize EnvChou4/Envelope Choukei 4: "<>setpagedevice" -*PageSize EnvISOB5/Envelope B5: "<>setpagedevice" -*PageSize EnvISOB6/Envelope B6: "<>setpagedevice" -*PageSize EnvKaku3/Envelope Kaku3: "<>setpagedevice" -*PageSize EnvMonarch/Envelope Monarch: "<>setpagedevice" -*PageSize EnvPersonal/Envelope Personal: "<>setpagedevice" -*PageSize EnvPRC1/Envelope PRC1: "<>setpagedevice" -*PageSize EnvPRC2/Envelope PRC2: "<>setpagedevice" -*PageSize EnvPRC3/Envelope PRC3: "<>setpagedevice" -*PageSize EnvPRC4/Envelope PRC4: "<>setpagedevice" -*PageSize EnvPRC5/Envelope PRC5PRC5: "<>setpagedevice" -*PageSize EnvPRC6/Envelope PRC6: "<>setpagedevice" -*PageSize EnvPRC7/Envelope PRC7: "<>setpagedevice" -*PageSize EnvPRC8/Envelope PRC8: "<>setpagedevice" -*PageSize EnvYou4/Envelope You4: "<>setpagedevice" -*PageSize FanFoldGerman/European Fanfold: "<>setpagedevice" -*PageSize FanFoldGermanLegal/European Fanfold Legal: "<>setpagedevice" -*PageSize ISOB5/B5: "<>setpagedevice" -*PageSize ISOB5Extra/B5 Oversize: "<>setpagedevice" -*PageSize ISOB6/B6: "<>setpagedevice" -*PageSize ISOB7/B7: "<>setpagedevice" -*PageSize LetterPlus/US Letter Oversize: "<>setpagedevice" -*PageSize Note/Note: "<>setpagedevice" -*PageSize Postcard/Postcard: "<>setpagedevice" -*PageSize PRC16K/PRC16K: "<>setpagedevice" -*PageSize PRC32K/PRC32K: "<>setpagedevice" -*PageSize PRC32KBig/PRC32K Oversize: "<>setpagedevice" -*PageSize Quarto/Quarto: "<>setpagedevice" -*PageSize Statement/Statement: "<>setpagedevice" *CloseUI: *PageSize *OpenUI *PageRegion/Media Size: PickOne *OrderDependency: 10 AnySetup *PageRegion *DefaultPageRegion: A4 *PageRegion A4/A4: "<>setpagedevice" -*PageRegion A5/A5: "<>setpagedevice" -*PageRegion A6/A6: "<>setpagedevice" -*PageRegion B6/JIS B6: "<>setpagedevice" -*PageRegion C6/Envelope C6: "<>setpagedevice" -*PageRegion EnvC5/Envelope C5: "<>setpagedevice" -*PageRegion EnvC6/Envelope C6: "<>setpagedevice" -*PageRegion EnvChou3/Envelope Choukei 3: "<>setpagedevice" -*PageRegion EnvDL/Envelope DL: "<>setpagedevice" -*PageRegion Env10/Envelope #10: "<>setpagedevice" -*PageRegion EnvItalian/Envelope Italian: "<>setpagedevice" -*PageRegion Executive/Executive: "<>setpagedevice" -*PageRegion Folio/Folio: "<>setpagedevice" -*PageRegion Legal/US Legal: "<>setpagedevice" -*PageRegion Letter/US Letter: "<>setpagedevice" -*PageRegion SISG5/SIS G5: "<>setpagedevice" -*PageRegion SISE5/SIS E5: "<>setpagedevice" -*PageRegion SAC16K/SAC 16K: "<>setpagedevice" -*PageRegion SAC32K/SAC 32K: "<>setpagedevice" -*PageRegion 7x9/7 x 9: "<>setpagedevice" -*PageRegion 8x10/8 x 10: "<>setpagedevice" -*PageRegion A4Small/A4 Small: "<>setpagedevice" -*PageRegion A4Plus/A4 Oversize: "<>setpagedevice" -*PageRegion A5Extra/A5 Oversize: "<>setpagedevice" -*PageRegion B5/JIS B5: "<>setpagedevice" -*PageRegion B7/JIS B7: "<>setpagedevice" -*PageRegion DoublePostcard/Postcard Double: "<>setpagedevice" -*PageRegion Env9/Envelope #9: "<>setpagedevice" -*PageRegion Env11/Envelope #11: "<>setpagedevice" -*PageRegion Env12/Envelope #12: "<>setpagedevice" -*PageRegion Env14/Envelope #14: "<>setpagedevice" -*PageRegion EnvC65/Envelope C65: "<>setpagedevice" -*PageRegion EnvChou4/Envelope Choukei 4: "<>setpagedevice" -*PageRegion EnvISOB5/Envelope B5: "<>setpagedevice" -*PageRegion EnvISOB6/Envelope B6: "<>setpagedevice" -*PageRegion EnvKaku3/Envelope Kaku3: "<>setpagedevice" -*PageRegion EnvMonarch/Envelope Monarch: "<>setpagedevice" -*PageRegion EnvPersonal/Envelope Personal: "<>setpagedevice" -*PageRegion EnvPRC1/Envelope PRC1: "<>setpagedevice" -*PageRegion EnvPRC2/Envelope PRC2: "<>setpagedevice" -*PageRegion EnvPRC3/Envelope PRC3: "<>setpagedevice" -*PageRegion EnvPRC4/Envelope PRC4: "<>setpagedevice" -*PageRegion EnvPRC5/Envelope PRC5PRC5: "<>setpagedevice" -*PageRegion EnvPRC6/Envelope PRC6: "<>setpagedevice" -*PageRegion EnvPRC7/Envelope PRC7: "<>setpagedevice" -*PageRegion EnvPRC8/Envelope PRC8: "<>setpagedevice" -*PageRegion EnvYou4/Envelope You4: "<>setpagedevice" -*PageRegion FanFoldGerman/European Fanfold: "<>setpagedevice" -*PageRegion FanFoldGermanLegal/European Fanfold Legal: "<>setpagedevice" -*PageRegion ISOB5/B5: "<>setpagedevice" -*PageRegion ISOB5Extra/B5 Oversize: "<>setpagedevice" -*PageRegion ISOB6/B6: "<>setpagedevice" -*PageRegion ISOB7/B7: "<>setpagedevice" -*PageRegion LetterPlus/US Letter Oversize: "<>setpagedevice" -*PageRegion Note/Note: "<>setpagedevice" -*PageRegion Postcard/Postcard: "<>setpagedevice" -*PageRegion PRC16K/PRC16K: "<>setpagedevice" -*PageRegion PRC32K/PRC32K: "<>setpagedevice" -*PageRegion PRC32KBig/PRC32K Oversize: "<>setpagedevice" -*PageRegion Quarto/Quarto: "<>setpagedevice" -*PageRegion Statement/Statement: "<>setpagedevice" *CloseUI: *PageRegion *DefaultImageableArea: A4 *ImageableArea A4/A4: "0 0 595 842" -*ImageableArea A5/A5: "0 0 420 595" -*ImageableArea A6/A6: "0 0 297 420" -*ImageableArea B6/JIS B6: "0 0 363 516" -*ImageableArea C6/Envelope C6: "0 0 323 459" -*ImageableArea EnvC5/Envelope C5: "0 0 459 649" -*ImageableArea EnvC6/Envelope C6: "0 0 323 459" -*ImageableArea EnvChou3/Envelope Choukei 3: "0 0 340 666" -*ImageableArea EnvDL/Envelope DL: "0 0 312 624" -*ImageableArea Env10/Envelope #10: "0 0 297 684" -*ImageableArea EnvItalian/Envelope Italian: "0 0 312 652" -*ImageableArea Executive/Executive: "0 0 522 756" -*ImageableArea Folio/Folio: "0 0 595 935" -*ImageableArea Legal/US Legal: "0 0 612 1008" -*ImageableArea Letter/US Letter: "0 0 612 792" -*ImageableArea SISG5/SIS G5: "0 0 479.055145263672 677.480346679688" -*ImageableArea SISE5/SIS E5: "0 0 325.984252929688 623.6220703125" -*ImageableArea SAC16K/SAC 16K: "0 0 532.913391113281 737.007873535156" -*ImageableArea SAC32K/SAC 32K: "0 0 368.503936767578 521.574829101562" -*ImageableArea 7x9/7 x 9: "0 0 504 648" -*ImageableArea 8x10/8 x 10: "0 0 576 720" -*ImageableArea A4Small/A4 Small: "0 0 595 842" -*ImageableArea A4Plus/A4 Oversize: "0 0 595 936" -*ImageableArea A5Extra/A5 Oversize: "0 0 492 668" -*ImageableArea B5/JIS B5: "0 0 516 729" -*ImageableArea B7/JIS B7: "0 0 258 363" -*ImageableArea DoublePostcard/Postcard Double: "0 0 567 420" -*ImageableArea Env9/Envelope #9: "0 0 279 639" -*ImageableArea Env11/Envelope #11: "0 0 324 747" -*ImageableArea Env12/Envelope #12: "0 0 342 792" -*ImageableArea Env14/Envelope #14: "0 0 360 828" -*ImageableArea EnvC65/Envelope C65: "0 0 324 648" -*ImageableArea EnvChou4/Envelope Choukei 4: "0 0 255 581" -*ImageableArea EnvISOB5/Envelope B5: "0 0 499 709" -*ImageableArea EnvISOB6/Envelope B6: "0 0 499 354" -*ImageableArea EnvKaku3/Envelope Kaku3: "0 0 612 785" -*ImageableArea EnvMonarch/Envelope Monarch: "0 0 279 540" -*ImageableArea EnvPersonal/Envelope Personal: "0 0 261 468" -*ImageableArea EnvPRC1/Envelope PRC1: "0 0 289 468" -*ImageableArea EnvPRC2/Envelope PRC2: "0 0 289 499" -*ImageableArea EnvPRC3/Envelope PRC3: "0 0 354 499" -*ImageableArea EnvPRC4/Envelope PRC4: "0 0 312 590" -*ImageableArea EnvPRC5/Envelope PRC5PRC5: "0 0 312 624" -*ImageableArea EnvPRC6/Envelope PRC6: "0 0 340 652" -*ImageableArea EnvPRC7/Envelope PRC7: "0 0 454 652" -*ImageableArea EnvPRC8/Envelope PRC8: "0 0 340 876" -*ImageableArea EnvYou4/Envelope You4: "0 0 298 666" -*ImageableArea FanFoldGerman/European Fanfold: "0 0 612 864" -*ImageableArea FanFoldGermanLegal/European Fanfold Legal: "0 0 612 936" -*ImageableArea ISOB5/B5: "0 0 499 709" -*ImageableArea ISOB5Extra/B5 Oversize: "0 0 570 782" -*ImageableArea ISOB6/B6: "0 0 354 499" -*ImageableArea ISOB7/B7: "0 0 249 354" -*ImageableArea LetterPlus/US Letter Oversize: "0 0 612 914" -*ImageableArea Note/Note: "0 0 612 792" -*ImageableArea Postcard/Postcard: "0 0 284 419" -*ImageableArea PRC16K/PRC16K: "0 0 414 610" -*ImageableArea PRC32K/PRC32K: "0 0 275 428" -*ImageableArea PRC32KBig/PRC32K Oversize: "0 0 275 428" -*ImageableArea Quarto/Quarto: "0 0 610 780" -*ImageableArea Statement/Statement: "0 0 396 612" *DefaultPaperDimension: A4 *PaperDimension A4/A4: "595 842" -*PaperDimension A5/A5: "420 595" -*PaperDimension A6/A6: "297 420" -*PaperDimension B6/JIS B6: "363 516" -*PaperDimension C6/Envelope C6: "323 459" -*PaperDimension EnvC5/Envelope C5: "459 649" -*PaperDimension EnvC6/Envelope C6: "323 459" -*PaperDimension EnvChou3/Envelope Choukei 3: "340 666" -*PaperDimension EnvDL/Envelope DL: "312 624" -*PaperDimension Env10/Envelope #10: "297 684" -*PaperDimension EnvItalian/Envelope Italian: "312 652" -*PaperDimension Executive/Executive: "522 756" -*PaperDimension Folio/Folio: "595 935" -*PaperDimension Legal/US Legal: "612 1008" -*PaperDimension Letter/US Letter: "612 792" -*PaperDimension SISG5/SIS G5: "479.055145263672 677.480346679688" -*PaperDimension SISE5/SIS E5: "325.984252929688 623.6220703125" -*PaperDimension SAC16K/SAC 16K: "532.913391113281 737.007873535156" -*PaperDimension SAC32K/SAC 32K: "368.503936767578 521.574829101562" -*PaperDimension 7x9/7 x 9: "504 648" -*PaperDimension 8x10/8 x 10: "576 720" -*PaperDimension A4Small/A4 Small: "595 842" -*PaperDimension A4Plus/A4 Oversize: "595 936" -*PaperDimension A5Extra/A5 Oversize: "492 668" -*PaperDimension B5/JIS B5: "516 729" -*PaperDimension B7/JIS B7: "258 363" -*PaperDimension DoublePostcard/Postcard Double: "567 420" -*PaperDimension Env9/Envelope #9: "279 639" -*PaperDimension Env11/Envelope #11: "324 747" -*PaperDimension Env12/Envelope #12: "342 792" -*PaperDimension Env14/Envelope #14: "360 828" -*PaperDimension EnvC65/Envelope C65: "324 648" -*PaperDimension EnvChou4/Envelope Choukei 4: "255 581" -*PaperDimension EnvISOB5/Envelope B5: "499 709" -*PaperDimension EnvISOB6/Envelope B6: "499 354" -*PaperDimension EnvKaku3/Envelope Kaku3: "612 785" -*PaperDimension EnvMonarch/Envelope Monarch: "279 540" -*PaperDimension EnvPersonal/Envelope Personal: "261 468" -*PaperDimension EnvPRC1/Envelope PRC1: "289 468" -*PaperDimension EnvPRC2/Envelope PRC2: "289 499" -*PaperDimension EnvPRC3/Envelope PRC3: "354 499" -*PaperDimension EnvPRC4/Envelope PRC4: "312 590" -*PaperDimension EnvPRC5/Envelope PRC5PRC5: "312 624" -*PaperDimension EnvPRC6/Envelope PRC6: "340 652" -*PaperDimension EnvPRC7/Envelope PRC7: "454 652" -*PaperDimension EnvPRC8/Envelope PRC8: "340 876" -*PaperDimension EnvYou4/Envelope You4: "298 666" -*PaperDimension FanFoldGerman/European Fanfold: "612 864" -*PaperDimension FanFoldGermanLegal/European Fanfold Legal: "612 936" -*PaperDimension ISOB5/B5: "499 709" -*PaperDimension ISOB5Extra/B5 Oversize: "570 782" -*PaperDimension ISOB6/B6: "354 499" -*PaperDimension ISOB7/B7: "249 354" -*PaperDimension LetterPlus/US Letter Oversize: "612 914" -*PaperDimension Note/Note: "612 792" -*PaperDimension Postcard/Postcard: "284 419" -*PaperDimension PRC16K/PRC16K: "414 610" -*PaperDimension PRC32K/PRC32K: "275 428" -*PaperDimension PRC32KBig/PRC32K Oversize: "275 428" -*PaperDimension Quarto/Quarto: "610 780" -*PaperDimension Statement/Statement: "396 612" -*MaxMediaWidth: "612" -*MaxMediaHeight: "1008.000061035156" -*HWMargins: 13.35000038147 13.35000038147 13.349998474121 13.349998474121 -*CustomPageSize True: "pop pop pop <>setpagedevice" -*ParamCustomPageSize Width: 1 points 212.598434448242 612 -*ParamCustomPageSize Height: 2 points 297.637817382812 1008.000061035156 -*ParamCustomPageSize WidthOffset: 3 points 0 0 -*ParamCustomPageSize HeightOffset: 4 points 0 0 -*ParamCustomPageSize Orientation: 5 int 0 0 *OpenUI *ColorModel/Color Mode: PickOne *OrderDependency: 10 AnySetup *ColorModel *DefaultColorModel: Gray @@ -304,16 +55,6 @@ *DefaultResolution: 600dpi *Resolution 600dpi/600 DPI: "<>setpagedevice" *CloseUI: *Resolution -*OpenUI *MediaType/Media Type: PickOne -*OrderDependency: 10 AnySetup *MediaType -*DefaultMediaType: Plain -*MediaType Plain/Plain Paper: "<>setpagedevice" -*MediaType Heavy/Heavy Paper: "<>setpagedevice" -*MediaType PlainL/Plain Paper L: "<>setpagedevice" -*MediaType HeavyH/Heavy Paper H: "<>setpagedevice" -*MediaType Transparency/Transparency: "<>setpagedevice" -*MediaType Envelope/Envelope: "<>setpagedevice" -*CloseUI: *MediaType *DefaultFont: Courier *Font AvantGarde-Book: Standard "(1.05)" Standard ROM *Font AvantGarde-BookOblique: Standard "(1.05)" Standard ROM @@ -350,4 +91,4 @@ *Font Times-Roman: Standard "(1.05)" Standard ROM *Font ZapfChancery-MediumItalic: Standard "(1.05)" Standard ROM *Font ZapfDingbats: Special "(001.005)" Special ROM -*% End of CNLB2K9.ppd, 21449 bytes. +*% End of CNLB2K9.ppd, 04141 bytes. diff --git a/Canon-LBP3000.ppd b/Canon-LBP3000.ppd index 3d2a7f1..3322f61 100644 --- a/Canon-LBP3000.ppd +++ b/Canon-LBP3000.ppd @@ -3,7 +3,7 @@ *%%%% Created by the CUPS PPD Compiler CUPS v2.2.10. *% (C)2020 Moses Chong *FormatVersion: "4.3" -*FileVersion: "0.1.3" +*FileVersion: "0.1.3-emergency-fix-1" *LanguageVersion: English *LanguageEncoding: ISOLatin1 *PCFileName: "CNLB3K.ppd" @@ -11,7 +11,7 @@ *Manufacturer: "Canon Inc" *ModelName: "Canon Inc LBP3000 r2c" *ShortNickName: "Canon Inc LBP3000 r2c" -*NickName: "Canon Inc LBP3000 r2c, 0.1.3" +*NickName: "Canon Inc LBP3000 r2c, 0.1.3-emergency-fix-1" *PSVersion: "(3010.000) 0" *LanguageLevel: "3" *ColorDevice: False @@ -350,4 +350,4 @@ *Font Times-Roman: Standard "(1.05)" Standard ROM *Font ZapfChancery-MediumItalic: Standard "(1.05)" Standard ROM *Font ZapfDingbats: Special "(001.005)" Special ROM -*% End of CNLB3K.ppd, 21409 bytes. +*% End of CNLB3K.ppd, 21441 bytes. diff --git a/src/canon-lbp.drv b/src/canon-lbp.drv index 3da6774..e50b07e 100644 --- a/src/canon-lbp.drv +++ b/src/canon-lbp.drv @@ -16,108 +16,21 @@ Copyright "(C)2020 Moses Chong" ColorModel "Gray/Grayscale" k chunky 2 Filter application/vnd.cups-raster 1 rastertocapt *Manufacturer "Canon Inc" -Version 0.1.3 +Version 0.1.3-emergency-fix-1 { Font * // Common Sizes *MediaSize A4 - MediaSize A5 - MediaSize A6 - MediaSize B6 - MediaSize C6 - MediaSize EnvC5 - MediaSize EnvC6 - MediaSize EnvChou3 - MediaSize EnvDL - MediaSize Env10 - MediaSize EnvItalian - MediaSize Executive // US 7.25x10.5 inch - MediaSize Folio // SE Asian F4 - MediaSize Legal - MediaSize Letter - MediaSize SISG5 - MediaSize SISE5 - MediaSize SAC16K - MediaSize SAC32K - - // Less Common Sizes - /* - * Sizes A6 and larger, and no wider than US Legal have - * been included here. - * - * PROTIP: Delete this section and recompile PPD, for a - * less cluttered Paper Size menu in most applications, - * if you don't use these sizes. If you use any of them, - * move the sizes you need from below to the section above, - * then delete the rest. - * - * NOTE: Some of the sizes appear to be identical to - * another at least in terms of width and length. There - * could be other differences, and may be useful in managing - * multiple trays on printers that support them. - * - */ - MediaSize 7x9 - MediaSize 8x10 - MediaSize A4Small // Same dimensions as A4 - MediaSize A4Plus // Longer than Folio (F4) by just one point - MediaSize A5Extra - MediaSize B5 - MediaSize B7 - MediaSize DoublePostcard - MediaSize Env9 - MediaSize Env11 - MediaSize Env12 - MediaSize Env14 - MediaSize EnvC65 - MediaSize EnvChou4 - MediaSize EnvISOB5 - MediaSize EnvISOB6 - MediaSize EnvKaku3 - MediaSize EnvMonarch - MediaSize EnvPersonal - MediaSize EnvPRC1 - MediaSize EnvPRC2 - MediaSize EnvPRC3 - MediaSize EnvPRC4 - MediaSize EnvPRC5 - MediaSize EnvPRC6 - MediaSize EnvPRC7 - MediaSize EnvPRC8 - MediaSize EnvYou4 - MediaSize FanFoldGerman - MediaSize FanFoldGermanLegal - MediaSize ISOB5 - MediaSize ISOB5Extra - MediaSize ISOB6 - MediaSize ISOB7 - MediaSize LetterPlus - MediaSize Note // Same dimensions as Letter (US) - MediaSize Postcard - MediaSize PRC16K - MediaSize PRC32K - MediaSize PRC32KBig - MediaSize Quarto - MediaSize Statement - // End Less Common Sizes - // Toner Save Option Option "captTonerSave/Toner Save" Boolean AnySetup 10 *Choice False/Disabled "<>setpagedevice" Choice True/Enabled "<>setpagedevice" *Resolution k 1 70 592 0 "600dpi/600 DPI" - MaxSize 215.9mm 355.6mm // US Legal - MediaType 0 "Plain/Plain Paper" - MediaType 1 "Heavy/Heavy Paper" - MediaType 2 "PlainL/Plain Paper L" - MediaType 3 "HeavyH/Heavy Paper H" - MediaType 4 "Transparency" - MediaType 5 "Envelope" - VariablePaperSize yes { - // nearly matched to Alexey Galakhov's original 2011 specs + /* LBP 2900/3010 */ + /* nearly matched to Alexey Galakhov's original 2011 specs */ *ModelName "LBP2900/LBP3010 r2c" FileName "Canon-LBP2900.ppd" MinSize 75mm 105mm @@ -126,6 +39,96 @@ Version 0.1.3 } { + /* LBP 3000, with multi-page size and type support */ + MaxSize 215.9mm 355.6mm // US Legal + MediaType 0 "Plain/Plain Paper" + MediaType 1 "Heavy/Heavy Paper" + MediaType 2 "PlainL/Plain Paper L" + MediaType 3 "HeavyH/Heavy Paper H" + MediaType 4 "Transparency" + MediaType 5 "Envelope" + VariablePaperSize yes + + MediaSize A5 + MediaSize A6 + MediaSize B6 + MediaSize C6 + MediaSize EnvC5 + MediaSize EnvC6 + MediaSize EnvChou3 + MediaSize EnvDL + MediaSize Env10 + MediaSize EnvItalian + MediaSize Executive // US 7.25x10.5 inch + MediaSize Folio // SE Asian F4 + MediaSize Legal + MediaSize Letter + MediaSize SISG5 + MediaSize SISE5 + MediaSize SAC16K + MediaSize SAC32K + + // Less Common Sizes + /* + * Sizes A6 and larger, and no wider than US Legal have + * been included here. + * + * PROTIP: Delete this section and recompile PPD, for a + * less cluttered Paper Size menu in most applications, + * if you don't use these sizes. If you use any of them, + * move the sizes you need from below to the section above, + * then delete the rest. + * + * NOTE: Some of the sizes appear to be identical to + * another at least in terms of width and length. There + * could be other differences, and may be useful in managing + * multiple trays on printers that support them. + * + */ + MediaSize 7x9 + MediaSize 8x10 + MediaSize A4Small // Same dimensions as A4 + MediaSize A4Plus // Longer than Folio (F4) by just one point + MediaSize A5Extra + MediaSize B5 + MediaSize B7 + MediaSize DoublePostcard + MediaSize Env9 + MediaSize Env11 + MediaSize Env12 + MediaSize Env14 + MediaSize EnvC65 + MediaSize EnvChou4 + MediaSize EnvISOB5 + MediaSize EnvISOB6 + MediaSize EnvKaku3 + MediaSize EnvMonarch + MediaSize EnvPersonal + MediaSize EnvPRC1 + MediaSize EnvPRC2 + MediaSize EnvPRC3 + MediaSize EnvPRC4 + MediaSize EnvPRC5 + MediaSize EnvPRC6 + MediaSize EnvPRC7 + MediaSize EnvPRC8 + MediaSize EnvYou4 + MediaSize FanFoldGerman + MediaSize FanFoldGermanLegal + MediaSize ISOB5 + MediaSize ISOB5Extra + MediaSize ISOB6 + MediaSize ISOB7 + MediaSize LetterPlus + MediaSize Note // Same dimensions as Letter (US) + MediaSize Postcard + MediaSize PRC16K + MediaSize PRC32K + MediaSize PRC32KBig + MediaSize Quarto + MediaSize Statement + // End Less Common Sizes + *ModelName "LBP3000 r2c" FileName "Canon-LBP3000.ppd" HWmargins 5mm 5mm 5mm 5mm diff --git a/src/prn_lbp2900.c b/src/prn_lbp2900.c index f82eec9..fd9cc13 100644 --- a/src/prn_lbp2900.c +++ b/src/prn_lbp2900.c @@ -299,7 +299,32 @@ static void lbp2900_page_setup(struct printer_state_s *state, struct page_dims_s *dims, unsigned width, unsigned height) { - /* FIXME: Do we still need this function? */ +/* + TODO: Only A4 printing is available with this page setup ops. + Multiple sizes will be enabled once more information becomes + available. + + Estimated target raster sizes at 600dpi + A4 4736x6784 + Letter 4864x6368 + Legal 4864x8192 + Executive 4128x6080 + 3x5 1344x2528 +*/ + (void) state; + (void) width; + dims->band_size = 70; + dims->line_size = 4736 / 8; + if (height > 6784) + dims->num_lines = 6784; + else + dims->num_lines = height; +} + +static void lbp3000_page_setup(struct printer_state_s *state, + struct page_dims_s *dims, + unsigned width, unsigned height) +{ (void) state; (void) width; (void) height; @@ -352,7 +377,7 @@ static struct lbp2900_ops_s lbp3000_ops = { .ops = { .job_prologue = lbp3000_job_prologue, /* different job prologue */ .job_epilogue = lbp2900_job_epilogue, - .page_setup = lbp2900_page_setup, + .page_setup = lbp3000_page_setup, .page_prologue = lbp2900_page_prologue, .page_epilogue = lbp2900_page_epilogue, .compress_band = ops_compress_band_hiscoa, From 2039702927efba641049e2c9f5b60fc5a59b50c6 Mon Sep 17 00:00:00 2001 From: mounaiban <29518031+mounaiban@users.noreply.github.com> Date: Fri, 10 Apr 2020 11:36:47 +1000 Subject: [PATCH 5/6] Restore LBP2900 page setup ops This page setup ops locks page size to A4 and media type to Plain Paper for LBP2900 and 3010, but is known to work. LBP3000 now gets its own page setup. Matching ppds have been included --- Canon-LBP2900.ppd | 265 +--------------------------------------------- Canon-LBP3000.ppd | 6 +- src/canon-lbp.drv | 183 ++++++++++++++++---------------- src/prn_lbp2900.c | 29 ++++- 4 files changed, 126 insertions(+), 357 deletions(-) diff --git a/Canon-LBP2900.ppd b/Canon-LBP2900.ppd index b57a82b..140a8e7 100644 --- a/Canon-LBP2900.ppd +++ b/Canon-LBP2900.ppd @@ -3,7 +3,7 @@ *%%%% Created by the CUPS PPD Compiler CUPS v2.2.10. *% (C)2020 Moses Chong *FormatVersion: "4.3" -*FileVersion: "0.1.3" +*FileVersion: "0.1.3-emergency-fix-1" *LanguageVersion: English *LanguageEncoding: ISOLatin1 *PCFileName: "CNLB2K9.ppd" @@ -11,7 +11,7 @@ *Manufacturer: "Canon Inc" *ModelName: "Canon Inc LBP2900/LBP3010 r2c" *ShortNickName: "Canon Inc LBP2900/LBP3010 r2c" -*NickName: "Canon Inc LBP2900/LBP3010 r2c, 0.1.3" +*NickName: "Canon Inc LBP2900/LBP3010 r2c, 0.1.3-emergency-fix-1" *PSVersion: "(3010.000) 0" *LanguageLevel: "3" *ColorDevice: False @@ -29,265 +29,16 @@ *OrderDependency: 10 AnySetup *PageSize *DefaultPageSize: A4 *PageSize A4/A4: "<>setpagedevice" -*PageSize A5/A5: "<>setpagedevice" -*PageSize A6/A6: "<>setpagedevice" -*PageSize B6/JIS B6: "<>setpagedevice" -*PageSize C6/Envelope C6: "<>setpagedevice" -*PageSize EnvC5/Envelope C5: "<>setpagedevice" -*PageSize EnvC6/Envelope C6: "<>setpagedevice" -*PageSize EnvChou3/Envelope Choukei 3: "<>setpagedevice" -*PageSize EnvDL/Envelope DL: "<>setpagedevice" -*PageSize Env10/Envelope #10: "<>setpagedevice" -*PageSize EnvItalian/Envelope Italian: "<>setpagedevice" -*PageSize Executive/Executive: "<>setpagedevice" -*PageSize Folio/Folio: "<>setpagedevice" -*PageSize Legal/US Legal: "<>setpagedevice" -*PageSize Letter/US Letter: "<>setpagedevice" -*PageSize SISG5/SIS G5: "<>setpagedevice" -*PageSize SISE5/SIS E5: "<>setpagedevice" -*PageSize SAC16K/SAC 16K: "<>setpagedevice" -*PageSize SAC32K/SAC 32K: "<>setpagedevice" -*PageSize 7x9/7 x 9: "<>setpagedevice" -*PageSize 8x10/8 x 10: "<>setpagedevice" -*PageSize A4Small/A4 Small: "<>setpagedevice" -*PageSize A4Plus/A4 Oversize: "<>setpagedevice" -*PageSize A5Extra/A5 Oversize: "<>setpagedevice" -*PageSize B5/JIS B5: "<>setpagedevice" -*PageSize B7/JIS B7: "<>setpagedevice" -*PageSize DoublePostcard/Postcard Double: "<>setpagedevice" -*PageSize Env9/Envelope #9: "<>setpagedevice" -*PageSize Env11/Envelope #11: "<>setpagedevice" -*PageSize Env12/Envelope #12: "<>setpagedevice" -*PageSize Env14/Envelope #14: "<>setpagedevice" -*PageSize EnvC65/Envelope C65: "<>setpagedevice" -*PageSize EnvChou4/Envelope Choukei 4: "<>setpagedevice" -*PageSize EnvISOB5/Envelope B5: "<>setpagedevice" -*PageSize EnvISOB6/Envelope B6: "<>setpagedevice" -*PageSize EnvKaku3/Envelope Kaku3: "<>setpagedevice" -*PageSize EnvMonarch/Envelope Monarch: "<>setpagedevice" -*PageSize EnvPersonal/Envelope Personal: "<>setpagedevice" -*PageSize EnvPRC1/Envelope PRC1: "<>setpagedevice" -*PageSize EnvPRC2/Envelope PRC2: "<>setpagedevice" -*PageSize EnvPRC3/Envelope PRC3: "<>setpagedevice" -*PageSize EnvPRC4/Envelope PRC4: "<>setpagedevice" -*PageSize EnvPRC5/Envelope PRC5PRC5: "<>setpagedevice" -*PageSize EnvPRC6/Envelope PRC6: "<>setpagedevice" -*PageSize EnvPRC7/Envelope PRC7: "<>setpagedevice" -*PageSize EnvPRC8/Envelope PRC8: "<>setpagedevice" -*PageSize EnvYou4/Envelope You4: "<>setpagedevice" -*PageSize FanFoldGerman/European Fanfold: "<>setpagedevice" -*PageSize FanFoldGermanLegal/European Fanfold Legal: "<>setpagedevice" -*PageSize ISOB5/B5: "<>setpagedevice" -*PageSize ISOB5Extra/B5 Oversize: "<>setpagedevice" -*PageSize ISOB6/B6: "<>setpagedevice" -*PageSize ISOB7/B7: "<>setpagedevice" -*PageSize LetterPlus/US Letter Oversize: "<>setpagedevice" -*PageSize Note/Note: "<>setpagedevice" -*PageSize Postcard/Postcard: "<>setpagedevice" -*PageSize PRC16K/PRC16K: "<>setpagedevice" -*PageSize PRC32K/PRC32K: "<>setpagedevice" -*PageSize PRC32KBig/PRC32K Oversize: "<>setpagedevice" -*PageSize Quarto/Quarto: "<>setpagedevice" -*PageSize Statement/Statement: "<>setpagedevice" *CloseUI: *PageSize *OpenUI *PageRegion/Media Size: PickOne *OrderDependency: 10 AnySetup *PageRegion *DefaultPageRegion: A4 *PageRegion A4/A4: "<>setpagedevice" -*PageRegion A5/A5: "<>setpagedevice" -*PageRegion A6/A6: "<>setpagedevice" -*PageRegion B6/JIS B6: "<>setpagedevice" -*PageRegion C6/Envelope C6: "<>setpagedevice" -*PageRegion EnvC5/Envelope C5: "<>setpagedevice" -*PageRegion EnvC6/Envelope C6: "<>setpagedevice" -*PageRegion EnvChou3/Envelope Choukei 3: "<>setpagedevice" -*PageRegion EnvDL/Envelope DL: "<>setpagedevice" -*PageRegion Env10/Envelope #10: "<>setpagedevice" -*PageRegion EnvItalian/Envelope Italian: "<>setpagedevice" -*PageRegion Executive/Executive: "<>setpagedevice" -*PageRegion Folio/Folio: "<>setpagedevice" -*PageRegion Legal/US Legal: "<>setpagedevice" -*PageRegion Letter/US Letter: "<>setpagedevice" -*PageRegion SISG5/SIS G5: "<>setpagedevice" -*PageRegion SISE5/SIS E5: "<>setpagedevice" -*PageRegion SAC16K/SAC 16K: "<>setpagedevice" -*PageRegion SAC32K/SAC 32K: "<>setpagedevice" -*PageRegion 7x9/7 x 9: "<>setpagedevice" -*PageRegion 8x10/8 x 10: "<>setpagedevice" -*PageRegion A4Small/A4 Small: "<>setpagedevice" -*PageRegion A4Plus/A4 Oversize: "<>setpagedevice" -*PageRegion A5Extra/A5 Oversize: "<>setpagedevice" -*PageRegion B5/JIS B5: "<>setpagedevice" -*PageRegion B7/JIS B7: "<>setpagedevice" -*PageRegion DoublePostcard/Postcard Double: "<>setpagedevice" -*PageRegion Env9/Envelope #9: "<>setpagedevice" -*PageRegion Env11/Envelope #11: "<>setpagedevice" -*PageRegion Env12/Envelope #12: "<>setpagedevice" -*PageRegion Env14/Envelope #14: "<>setpagedevice" -*PageRegion EnvC65/Envelope C65: "<>setpagedevice" -*PageRegion EnvChou4/Envelope Choukei 4: "<>setpagedevice" -*PageRegion EnvISOB5/Envelope B5: "<>setpagedevice" -*PageRegion EnvISOB6/Envelope B6: "<>setpagedevice" -*PageRegion EnvKaku3/Envelope Kaku3: "<>setpagedevice" -*PageRegion EnvMonarch/Envelope Monarch: "<>setpagedevice" -*PageRegion EnvPersonal/Envelope Personal: "<>setpagedevice" -*PageRegion EnvPRC1/Envelope PRC1: "<>setpagedevice" -*PageRegion EnvPRC2/Envelope PRC2: "<>setpagedevice" -*PageRegion EnvPRC3/Envelope PRC3: "<>setpagedevice" -*PageRegion EnvPRC4/Envelope PRC4: "<>setpagedevice" -*PageRegion EnvPRC5/Envelope PRC5PRC5: "<>setpagedevice" -*PageRegion EnvPRC6/Envelope PRC6: "<>setpagedevice" -*PageRegion EnvPRC7/Envelope PRC7: "<>setpagedevice" -*PageRegion EnvPRC8/Envelope PRC8: "<>setpagedevice" -*PageRegion EnvYou4/Envelope You4: "<>setpagedevice" -*PageRegion FanFoldGerman/European Fanfold: "<>setpagedevice" -*PageRegion FanFoldGermanLegal/European Fanfold Legal: "<>setpagedevice" -*PageRegion ISOB5/B5: "<>setpagedevice" -*PageRegion ISOB5Extra/B5 Oversize: "<>setpagedevice" -*PageRegion ISOB6/B6: "<>setpagedevice" -*PageRegion ISOB7/B7: "<>setpagedevice" -*PageRegion LetterPlus/US Letter Oversize: "<>setpagedevice" -*PageRegion Note/Note: "<>setpagedevice" -*PageRegion Postcard/Postcard: "<>setpagedevice" -*PageRegion PRC16K/PRC16K: "<>setpagedevice" -*PageRegion PRC32K/PRC32K: "<>setpagedevice" -*PageRegion PRC32KBig/PRC32K Oversize: "<>setpagedevice" -*PageRegion Quarto/Quarto: "<>setpagedevice" -*PageRegion Statement/Statement: "<>setpagedevice" *CloseUI: *PageRegion *DefaultImageableArea: A4 *ImageableArea A4/A4: "0 0 595 842" -*ImageableArea A5/A5: "0 0 420 595" -*ImageableArea A6/A6: "0 0 297 420" -*ImageableArea B6/JIS B6: "0 0 363 516" -*ImageableArea C6/Envelope C6: "0 0 323 459" -*ImageableArea EnvC5/Envelope C5: "0 0 459 649" -*ImageableArea EnvC6/Envelope C6: "0 0 323 459" -*ImageableArea EnvChou3/Envelope Choukei 3: "0 0 340 666" -*ImageableArea EnvDL/Envelope DL: "0 0 312 624" -*ImageableArea Env10/Envelope #10: "0 0 297 684" -*ImageableArea EnvItalian/Envelope Italian: "0 0 312 652" -*ImageableArea Executive/Executive: "0 0 522 756" -*ImageableArea Folio/Folio: "0 0 595 935" -*ImageableArea Legal/US Legal: "0 0 612 1008" -*ImageableArea Letter/US Letter: "0 0 612 792" -*ImageableArea SISG5/SIS G5: "0 0 479.055145263672 677.480346679688" -*ImageableArea SISE5/SIS E5: "0 0 325.984252929688 623.6220703125" -*ImageableArea SAC16K/SAC 16K: "0 0 532.913391113281 737.007873535156" -*ImageableArea SAC32K/SAC 32K: "0 0 368.503936767578 521.574829101562" -*ImageableArea 7x9/7 x 9: "0 0 504 648" -*ImageableArea 8x10/8 x 10: "0 0 576 720" -*ImageableArea A4Small/A4 Small: "0 0 595 842" -*ImageableArea A4Plus/A4 Oversize: "0 0 595 936" -*ImageableArea A5Extra/A5 Oversize: "0 0 492 668" -*ImageableArea B5/JIS B5: "0 0 516 729" -*ImageableArea B7/JIS B7: "0 0 258 363" -*ImageableArea DoublePostcard/Postcard Double: "0 0 567 420" -*ImageableArea Env9/Envelope #9: "0 0 279 639" -*ImageableArea Env11/Envelope #11: "0 0 324 747" -*ImageableArea Env12/Envelope #12: "0 0 342 792" -*ImageableArea Env14/Envelope #14: "0 0 360 828" -*ImageableArea EnvC65/Envelope C65: "0 0 324 648" -*ImageableArea EnvChou4/Envelope Choukei 4: "0 0 255 581" -*ImageableArea EnvISOB5/Envelope B5: "0 0 499 709" -*ImageableArea EnvISOB6/Envelope B6: "0 0 499 354" -*ImageableArea EnvKaku3/Envelope Kaku3: "0 0 612 785" -*ImageableArea EnvMonarch/Envelope Monarch: "0 0 279 540" -*ImageableArea EnvPersonal/Envelope Personal: "0 0 261 468" -*ImageableArea EnvPRC1/Envelope PRC1: "0 0 289 468" -*ImageableArea EnvPRC2/Envelope PRC2: "0 0 289 499" -*ImageableArea EnvPRC3/Envelope PRC3: "0 0 354 499" -*ImageableArea EnvPRC4/Envelope PRC4: "0 0 312 590" -*ImageableArea EnvPRC5/Envelope PRC5PRC5: "0 0 312 624" -*ImageableArea EnvPRC6/Envelope PRC6: "0 0 340 652" -*ImageableArea EnvPRC7/Envelope PRC7: "0 0 454 652" -*ImageableArea EnvPRC8/Envelope PRC8: "0 0 340 876" -*ImageableArea EnvYou4/Envelope You4: "0 0 298 666" -*ImageableArea FanFoldGerman/European Fanfold: "0 0 612 864" -*ImageableArea FanFoldGermanLegal/European Fanfold Legal: "0 0 612 936" -*ImageableArea ISOB5/B5: "0 0 499 709" -*ImageableArea ISOB5Extra/B5 Oversize: "0 0 570 782" -*ImageableArea ISOB6/B6: "0 0 354 499" -*ImageableArea ISOB7/B7: "0 0 249 354" -*ImageableArea LetterPlus/US Letter Oversize: "0 0 612 914" -*ImageableArea Note/Note: "0 0 612 792" -*ImageableArea Postcard/Postcard: "0 0 284 419" -*ImageableArea PRC16K/PRC16K: "0 0 414 610" -*ImageableArea PRC32K/PRC32K: "0 0 275 428" -*ImageableArea PRC32KBig/PRC32K Oversize: "0 0 275 428" -*ImageableArea Quarto/Quarto: "0 0 610 780" -*ImageableArea Statement/Statement: "0 0 396 612" *DefaultPaperDimension: A4 *PaperDimension A4/A4: "595 842" -*PaperDimension A5/A5: "420 595" -*PaperDimension A6/A6: "297 420" -*PaperDimension B6/JIS B6: "363 516" -*PaperDimension C6/Envelope C6: "323 459" -*PaperDimension EnvC5/Envelope C5: "459 649" -*PaperDimension EnvC6/Envelope C6: "323 459" -*PaperDimension EnvChou3/Envelope Choukei 3: "340 666" -*PaperDimension EnvDL/Envelope DL: "312 624" -*PaperDimension Env10/Envelope #10: "297 684" -*PaperDimension EnvItalian/Envelope Italian: "312 652" -*PaperDimension Executive/Executive: "522 756" -*PaperDimension Folio/Folio: "595 935" -*PaperDimension Legal/US Legal: "612 1008" -*PaperDimension Letter/US Letter: "612 792" -*PaperDimension SISG5/SIS G5: "479.055145263672 677.480346679688" -*PaperDimension SISE5/SIS E5: "325.984252929688 623.6220703125" -*PaperDimension SAC16K/SAC 16K: "532.913391113281 737.007873535156" -*PaperDimension SAC32K/SAC 32K: "368.503936767578 521.574829101562" -*PaperDimension 7x9/7 x 9: "504 648" -*PaperDimension 8x10/8 x 10: "576 720" -*PaperDimension A4Small/A4 Small: "595 842" -*PaperDimension A4Plus/A4 Oversize: "595 936" -*PaperDimension A5Extra/A5 Oversize: "492 668" -*PaperDimension B5/JIS B5: "516 729" -*PaperDimension B7/JIS B7: "258 363" -*PaperDimension DoublePostcard/Postcard Double: "567 420" -*PaperDimension Env9/Envelope #9: "279 639" -*PaperDimension Env11/Envelope #11: "324 747" -*PaperDimension Env12/Envelope #12: "342 792" -*PaperDimension Env14/Envelope #14: "360 828" -*PaperDimension EnvC65/Envelope C65: "324 648" -*PaperDimension EnvChou4/Envelope Choukei 4: "255 581" -*PaperDimension EnvISOB5/Envelope B5: "499 709" -*PaperDimension EnvISOB6/Envelope B6: "499 354" -*PaperDimension EnvKaku3/Envelope Kaku3: "612 785" -*PaperDimension EnvMonarch/Envelope Monarch: "279 540" -*PaperDimension EnvPersonal/Envelope Personal: "261 468" -*PaperDimension EnvPRC1/Envelope PRC1: "289 468" -*PaperDimension EnvPRC2/Envelope PRC2: "289 499" -*PaperDimension EnvPRC3/Envelope PRC3: "354 499" -*PaperDimension EnvPRC4/Envelope PRC4: "312 590" -*PaperDimension EnvPRC5/Envelope PRC5PRC5: "312 624" -*PaperDimension EnvPRC6/Envelope PRC6: "340 652" -*PaperDimension EnvPRC7/Envelope PRC7: "454 652" -*PaperDimension EnvPRC8/Envelope PRC8: "340 876" -*PaperDimension EnvYou4/Envelope You4: "298 666" -*PaperDimension FanFoldGerman/European Fanfold: "612 864" -*PaperDimension FanFoldGermanLegal/European Fanfold Legal: "612 936" -*PaperDimension ISOB5/B5: "499 709" -*PaperDimension ISOB5Extra/B5 Oversize: "570 782" -*PaperDimension ISOB6/B6: "354 499" -*PaperDimension ISOB7/B7: "249 354" -*PaperDimension LetterPlus/US Letter Oversize: "612 914" -*PaperDimension Note/Note: "612 792" -*PaperDimension Postcard/Postcard: "284 419" -*PaperDimension PRC16K/PRC16K: "414 610" -*PaperDimension PRC32K/PRC32K: "275 428" -*PaperDimension PRC32KBig/PRC32K Oversize: "275 428" -*PaperDimension Quarto/Quarto: "610 780" -*PaperDimension Statement/Statement: "396 612" -*MaxMediaWidth: "612" -*MaxMediaHeight: "1008.000061035156" -*HWMargins: 13.35000038147 13.35000038147 13.349998474121 13.349998474121 -*CustomPageSize True: "pop pop pop <>setpagedevice" -*ParamCustomPageSize Width: 1 points 212.598434448242 612 -*ParamCustomPageSize Height: 2 points 297.637817382812 1008.000061035156 -*ParamCustomPageSize WidthOffset: 3 points 0 0 -*ParamCustomPageSize HeightOffset: 4 points 0 0 -*ParamCustomPageSize Orientation: 5 int 0 0 *OpenUI *ColorModel/Color Mode: PickOne *OrderDependency: 10 AnySetup *ColorModel *DefaultColorModel: Gray @@ -304,16 +55,6 @@ *DefaultResolution: 600dpi *Resolution 600dpi/600 DPI: "<>setpagedevice" *CloseUI: *Resolution -*OpenUI *MediaType/Media Type: PickOne -*OrderDependency: 10 AnySetup *MediaType -*DefaultMediaType: Plain -*MediaType Plain/Plain Paper: "<>setpagedevice" -*MediaType Heavy/Heavy Paper: "<>setpagedevice" -*MediaType PlainL/Plain Paper L: "<>setpagedevice" -*MediaType HeavyH/Heavy Paper H: "<>setpagedevice" -*MediaType Transparency/Transparency: "<>setpagedevice" -*MediaType Envelope/Envelope: "<>setpagedevice" -*CloseUI: *MediaType *DefaultFont: Courier *Font AvantGarde-Book: Standard "(1.05)" Standard ROM *Font AvantGarde-BookOblique: Standard "(1.05)" Standard ROM @@ -350,4 +91,4 @@ *Font Times-Roman: Standard "(1.05)" Standard ROM *Font ZapfChancery-MediumItalic: Standard "(1.05)" Standard ROM *Font ZapfDingbats: Special "(001.005)" Special ROM -*% End of CNLB2K9.ppd, 21449 bytes. +*% End of CNLB2K9.ppd, 04141 bytes. diff --git a/Canon-LBP3000.ppd b/Canon-LBP3000.ppd index 3d2a7f1..3322f61 100644 --- a/Canon-LBP3000.ppd +++ b/Canon-LBP3000.ppd @@ -3,7 +3,7 @@ *%%%% Created by the CUPS PPD Compiler CUPS v2.2.10. *% (C)2020 Moses Chong *FormatVersion: "4.3" -*FileVersion: "0.1.3" +*FileVersion: "0.1.3-emergency-fix-1" *LanguageVersion: English *LanguageEncoding: ISOLatin1 *PCFileName: "CNLB3K.ppd" @@ -11,7 +11,7 @@ *Manufacturer: "Canon Inc" *ModelName: "Canon Inc LBP3000 r2c" *ShortNickName: "Canon Inc LBP3000 r2c" -*NickName: "Canon Inc LBP3000 r2c, 0.1.3" +*NickName: "Canon Inc LBP3000 r2c, 0.1.3-emergency-fix-1" *PSVersion: "(3010.000) 0" *LanguageLevel: "3" *ColorDevice: False @@ -350,4 +350,4 @@ *Font Times-Roman: Standard "(1.05)" Standard ROM *Font ZapfChancery-MediumItalic: Standard "(1.05)" Standard ROM *Font ZapfDingbats: Special "(001.005)" Special ROM -*% End of CNLB3K.ppd, 21409 bytes. +*% End of CNLB3K.ppd, 21441 bytes. diff --git a/src/canon-lbp.drv b/src/canon-lbp.drv index 3da6774..e50b07e 100644 --- a/src/canon-lbp.drv +++ b/src/canon-lbp.drv @@ -16,108 +16,21 @@ Copyright "(C)2020 Moses Chong" ColorModel "Gray/Grayscale" k chunky 2 Filter application/vnd.cups-raster 1 rastertocapt *Manufacturer "Canon Inc" -Version 0.1.3 +Version 0.1.3-emergency-fix-1 { Font * // Common Sizes *MediaSize A4 - MediaSize A5 - MediaSize A6 - MediaSize B6 - MediaSize C6 - MediaSize EnvC5 - MediaSize EnvC6 - MediaSize EnvChou3 - MediaSize EnvDL - MediaSize Env10 - MediaSize EnvItalian - MediaSize Executive // US 7.25x10.5 inch - MediaSize Folio // SE Asian F4 - MediaSize Legal - MediaSize Letter - MediaSize SISG5 - MediaSize SISE5 - MediaSize SAC16K - MediaSize SAC32K - - // Less Common Sizes - /* - * Sizes A6 and larger, and no wider than US Legal have - * been included here. - * - * PROTIP: Delete this section and recompile PPD, for a - * less cluttered Paper Size menu in most applications, - * if you don't use these sizes. If you use any of them, - * move the sizes you need from below to the section above, - * then delete the rest. - * - * NOTE: Some of the sizes appear to be identical to - * another at least in terms of width and length. There - * could be other differences, and may be useful in managing - * multiple trays on printers that support them. - * - */ - MediaSize 7x9 - MediaSize 8x10 - MediaSize A4Small // Same dimensions as A4 - MediaSize A4Plus // Longer than Folio (F4) by just one point - MediaSize A5Extra - MediaSize B5 - MediaSize B7 - MediaSize DoublePostcard - MediaSize Env9 - MediaSize Env11 - MediaSize Env12 - MediaSize Env14 - MediaSize EnvC65 - MediaSize EnvChou4 - MediaSize EnvISOB5 - MediaSize EnvISOB6 - MediaSize EnvKaku3 - MediaSize EnvMonarch - MediaSize EnvPersonal - MediaSize EnvPRC1 - MediaSize EnvPRC2 - MediaSize EnvPRC3 - MediaSize EnvPRC4 - MediaSize EnvPRC5 - MediaSize EnvPRC6 - MediaSize EnvPRC7 - MediaSize EnvPRC8 - MediaSize EnvYou4 - MediaSize FanFoldGerman - MediaSize FanFoldGermanLegal - MediaSize ISOB5 - MediaSize ISOB5Extra - MediaSize ISOB6 - MediaSize ISOB7 - MediaSize LetterPlus - MediaSize Note // Same dimensions as Letter (US) - MediaSize Postcard - MediaSize PRC16K - MediaSize PRC32K - MediaSize PRC32KBig - MediaSize Quarto - MediaSize Statement - // End Less Common Sizes - // Toner Save Option Option "captTonerSave/Toner Save" Boolean AnySetup 10 *Choice False/Disabled "<>setpagedevice" Choice True/Enabled "<>setpagedevice" *Resolution k 1 70 592 0 "600dpi/600 DPI" - MaxSize 215.9mm 355.6mm // US Legal - MediaType 0 "Plain/Plain Paper" - MediaType 1 "Heavy/Heavy Paper" - MediaType 2 "PlainL/Plain Paper L" - MediaType 3 "HeavyH/Heavy Paper H" - MediaType 4 "Transparency" - MediaType 5 "Envelope" - VariablePaperSize yes { - // nearly matched to Alexey Galakhov's original 2011 specs + /* LBP 2900/3010 */ + /* nearly matched to Alexey Galakhov's original 2011 specs */ *ModelName "LBP2900/LBP3010 r2c" FileName "Canon-LBP2900.ppd" MinSize 75mm 105mm @@ -126,6 +39,96 @@ Version 0.1.3 } { + /* LBP 3000, with multi-page size and type support */ + MaxSize 215.9mm 355.6mm // US Legal + MediaType 0 "Plain/Plain Paper" + MediaType 1 "Heavy/Heavy Paper" + MediaType 2 "PlainL/Plain Paper L" + MediaType 3 "HeavyH/Heavy Paper H" + MediaType 4 "Transparency" + MediaType 5 "Envelope" + VariablePaperSize yes + + MediaSize A5 + MediaSize A6 + MediaSize B6 + MediaSize C6 + MediaSize EnvC5 + MediaSize EnvC6 + MediaSize EnvChou3 + MediaSize EnvDL + MediaSize Env10 + MediaSize EnvItalian + MediaSize Executive // US 7.25x10.5 inch + MediaSize Folio // SE Asian F4 + MediaSize Legal + MediaSize Letter + MediaSize SISG5 + MediaSize SISE5 + MediaSize SAC16K + MediaSize SAC32K + + // Less Common Sizes + /* + * Sizes A6 and larger, and no wider than US Legal have + * been included here. + * + * PROTIP: Delete this section and recompile PPD, for a + * less cluttered Paper Size menu in most applications, + * if you don't use these sizes. If you use any of them, + * move the sizes you need from below to the section above, + * then delete the rest. + * + * NOTE: Some of the sizes appear to be identical to + * another at least in terms of width and length. There + * could be other differences, and may be useful in managing + * multiple trays on printers that support them. + * + */ + MediaSize 7x9 + MediaSize 8x10 + MediaSize A4Small // Same dimensions as A4 + MediaSize A4Plus // Longer than Folio (F4) by just one point + MediaSize A5Extra + MediaSize B5 + MediaSize B7 + MediaSize DoublePostcard + MediaSize Env9 + MediaSize Env11 + MediaSize Env12 + MediaSize Env14 + MediaSize EnvC65 + MediaSize EnvChou4 + MediaSize EnvISOB5 + MediaSize EnvISOB6 + MediaSize EnvKaku3 + MediaSize EnvMonarch + MediaSize EnvPersonal + MediaSize EnvPRC1 + MediaSize EnvPRC2 + MediaSize EnvPRC3 + MediaSize EnvPRC4 + MediaSize EnvPRC5 + MediaSize EnvPRC6 + MediaSize EnvPRC7 + MediaSize EnvPRC8 + MediaSize EnvYou4 + MediaSize FanFoldGerman + MediaSize FanFoldGermanLegal + MediaSize ISOB5 + MediaSize ISOB5Extra + MediaSize ISOB6 + MediaSize ISOB7 + MediaSize LetterPlus + MediaSize Note // Same dimensions as Letter (US) + MediaSize Postcard + MediaSize PRC16K + MediaSize PRC32K + MediaSize PRC32KBig + MediaSize Quarto + MediaSize Statement + // End Less Common Sizes + *ModelName "LBP3000 r2c" FileName "Canon-LBP3000.ppd" HWmargins 5mm 5mm 5mm 5mm diff --git a/src/prn_lbp2900.c b/src/prn_lbp2900.c index f82eec9..fd9cc13 100644 --- a/src/prn_lbp2900.c +++ b/src/prn_lbp2900.c @@ -299,7 +299,32 @@ static void lbp2900_page_setup(struct printer_state_s *state, struct page_dims_s *dims, unsigned width, unsigned height) { - /* FIXME: Do we still need this function? */ +/* + TODO: Only A4 printing is available with this page setup ops. + Multiple sizes will be enabled once more information becomes + available. + + Estimated target raster sizes at 600dpi + A4 4736x6784 + Letter 4864x6368 + Legal 4864x8192 + Executive 4128x6080 + 3x5 1344x2528 +*/ + (void) state; + (void) width; + dims->band_size = 70; + dims->line_size = 4736 / 8; + if (height > 6784) + dims->num_lines = 6784; + else + dims->num_lines = height; +} + +static void lbp3000_page_setup(struct printer_state_s *state, + struct page_dims_s *dims, + unsigned width, unsigned height) +{ (void) state; (void) width; (void) height; @@ -352,7 +377,7 @@ static struct lbp2900_ops_s lbp3000_ops = { .ops = { .job_prologue = lbp3000_job_prologue, /* different job prologue */ .job_epilogue = lbp2900_job_epilogue, - .page_setup = lbp2900_page_setup, + .page_setup = lbp3000_page_setup, .page_prologue = lbp2900_page_prologue, .page_epilogue = lbp2900_page_epilogue, .compress_band = ops_compress_band_hiscoa, From 4e5b30ce95e0631002a86f55359667b007abf31c Mon Sep 17 00:00:00 2001 From: mounaiban <29518031+mounaiban@users.noreply.github.com> Date: Fri, 10 Apr 2020 14:01:05 +1000 Subject: [PATCH 6/6] Split page setup ops LBP2900 page setup ops partially restored to its state as of 216fddb, but with Toner Save support enabled LBP3010 page setup ops partially restored to its state as of 63788ce, but with Toner Save support enabled --- src/prn_lbp2900.c | 131 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 124 insertions(+), 7 deletions(-) diff --git a/src/prn_lbp2900.c b/src/prn_lbp2900.c index fd9cc13..98b23a6 100644 --- a/src/prn_lbp2900.c +++ b/src/prn_lbp2900.c @@ -157,6 +157,63 @@ static bool lbp2900_page_prologue(struct printer_state_s *state, const struct pa size_t s; uint8_t buf[16]; + uint8_t mt = 0x00; /* media type, 0x00: Plain Paper */ + uint8_t save = dims->toner_save; + uint8_t fm = 0x01; /* fuser mode (temperature?) */ + uint8_t air = 0x02; /* image refinement mode 0x02: Windows CAPT default */ + + /* FIXME: pageparms only support A4 plain paper printing */ + uint8_t pageparms[] = { + /* Bytes 0-21 (0x00 to 0x15) */ + 0x00, 0x00, 0x30, 0x2A, /* sz */ 0x02, 0x00, 0x00, 0x00, + 0x1F, 0x1F, 0x1F, 0x1F, mt, /* adapt */ 0x11, 0x04, 0x00, + 0x01, 0x01, /* img ref */ air, save, 0x00, 0x00, + /* Bytes 22-33 (0x16 to 0x21) */ + /*Margin height? 120*/ 0x78, 0x00, + /*Margin width? 96*/ 0x60, 0x00, + LO(dims->line_size), HI(dims->line_size), + LO(dims->num_lines), HI(dims->num_lines), + LO(dims->paper_width), HI(dims->paper_width), + LO(dims->paper_height), HI(dims->paper_height), + /* Bytes 34-39 (0x22 to 0x27) */ + 0x00, 0x00, fm, 0x00, 0x00, 0x00, + }; + + (void) state; + + status = lbp2900_get_status(state->ops); + if (FLAG(status, CAPT_FL_UNINIT1) || FLAG(status, CAPT_FL_UNINIT2)) { + capt_sendrecv(CAPT_START_1, NULL, 0, NULL, 0); + capt_sendrecv(CAPT_START_2, NULL, 0, NULL, 0); + capt_sendrecv(CAPT_START_3, NULL, 0, NULL, 0); + lbp2900_wait_ready(state->ops); + capt_sendrecv(CAPT_UPLOAD_2, magicbuf_2, ARRAY_SIZE(magicbuf_2), NULL, 0); + lbp2900_wait_ready(state->ops); + } + + while (1) { + if (! FLAG(lbp2900_get_status(state->ops), CAPT_FL_BUFFERFULL)) + break; + sleep(1); + } + + capt_multi_begin(CAPT_SET_PARMS); + capt_multi_add(CAPT_SET_PARM_PAGE, pageparms, sizeof(pageparms)); + s = hiscoa_format_params(buf, sizeof(buf), &hiscoa_default_params); + capt_multi_add(CAPT_SET_PARM_HISCOA, buf, s); + capt_multi_add(CAPT_SET_PARM_1, NULL, 0); + capt_multi_add(CAPT_SET_PARM_2, NULL, 0); + capt_multi_send(); + + return true; +} + +static bool lbp3000_page_prologue(struct printer_state_s *state, const struct page_dims_s *dims) +{ + const struct capt_status_s *status; + size_t s; + uint8_t buf[16]; + uint8_t save = dims->toner_save; uint8_t fm = 0x00; /* fuser mode (temperature?) */ @@ -191,7 +248,7 @@ static bool lbp2900_page_prologue(struct printer_state_s *state, const struct pa uint8_t pageparms[] = { /* Bytes 0-21 (0x00 to 0x15) */ 0x00, 0x00, 0x30, 0x2A, /* sz */ 0x02, 0x00, 0x00, 0x00, - 0x1C, 0x1C, 0x1C, 0x1C, dims->media_type, /* adapt */ 0x11, 0x04, 0x00, + 0x1F, 0x1F, 0x1F, 0x1F, dims->media_type, /* adapt */ 0x11, 0x04, 0x00, 0x01, 0x01, /* img ref */ 0x00, save, 0x00, 0x00, /* Bytes 22-33 (0x16 to 0x21) */ LO(dims->margin_height), HI(dims->margin_height), @@ -202,10 +259,70 @@ static bool lbp2900_page_prologue(struct printer_state_s *state, const struct pa LO(dims->paper_height), HI(dims->paper_height), /* Bytes 34-39 (0x22 to 0x27) */ 0x00, 0x00, fm, 0x00, 0x00, 0x00, - /* Spare bytes for later - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - */ + }; + + (void) state; + + status = lbp2900_get_status(state->ops); + if (FLAG(status, CAPT_FL_UNINIT1) || FLAG(status, CAPT_FL_UNINIT2)) { + capt_sendrecv(CAPT_START_1, NULL, 0, NULL, 0); + capt_sendrecv(CAPT_START_2, NULL, 0, NULL, 0); + capt_sendrecv(CAPT_START_3, NULL, 0, NULL, 0); + + /* FIXME: wait for printer is free (could it be potentially dangerous or really mandatory?) */ + while ( ! FLAG(lbp2900_get_status(state->ops), ((4 << 16) | (1 << 0)) ) ) + sleep(1); + lbp2900_get_status(state->ops); + + + lbp2900_wait_ready(state->ops); + capt_sendrecv(CAPT_UPLOAD_2, magicbuf_2, ARRAY_SIZE(magicbuf_2), NULL, 0); + lbp2900_wait_ready(state->ops); + } + + while (1) { + if (! FLAG(lbp2900_get_status(state->ops), CAPT_FL_BUFFERFULL)) + break; + sleep(1); + } + + capt_multi_begin(CAPT_SET_PARMS); + capt_multi_add(CAPT_SET_PARM_PAGE, pageparms, sizeof(pageparms)); + s = hiscoa_format_params(buf, sizeof(buf), &hiscoa_default_params); + capt_multi_add(CAPT_SET_PARM_HISCOA, buf, s); + capt_multi_add(CAPT_SET_PARM_1, NULL, 0); + capt_multi_add(CAPT_SET_PARM_2, NULL, 0); + capt_multi_send(); + + return true; +} + +static bool lbp3010_page_prologue(struct printer_state_s *state, const struct page_dims_s *dims) +{ + const struct capt_status_s *status; + size_t s; + uint8_t buf[16]; + + uint8_t mt = 0x00; /* media type, 0x00: Plain Paper */ + uint8_t save = dims->toner_save; + uint8_t fm = 0x01; /* fuser mode (temperature?) */ + uint8_t air = 0x00; /* image refinement mode */ + + /* FIXME: pageparms only support A4 plain paper printing */ + uint8_t pageparms[] = { + /* Bytes 0-21 (0x00 to 0x15) */ + 0x00, 0x00, 0x30, 0x2A, /* sz */ 0x02, 0x00, 0x00, 0x00, + 0x1C, 0x1C, 0x1C, 0x1C, mt, /* adapt */ 0x11, 0x04, 0x00, + 0x01, 0x01, /* img ref */ air, save, 0x00, 0x00, + /* Bytes 22-33 (0x16 to 0x21) */ + /*Margin height? 118*/ 0x76, 0x00, + /*Margin width? 78*/ 0x4e, 0x00, + LO(dims->line_size), HI(dims->line_size), + LO(dims->num_lines), HI(dims->num_lines), + LO(dims->paper_width), HI(dims->paper_width), + LO(dims->paper_height), HI(dims->paper_height), + /* Bytes 34-39 (0x22 to 0x27) */ + 0x00, 0x00, fm, 0x00, 0x00, 0x00, }; (void) state; @@ -378,7 +495,7 @@ static struct lbp2900_ops_s lbp3000_ops = { .job_prologue = lbp3000_job_prologue, /* different job prologue */ .job_epilogue = lbp2900_job_epilogue, .page_setup = lbp3000_page_setup, - .page_prologue = lbp2900_page_prologue, + .page_prologue = lbp3000_page_prologue, .page_epilogue = lbp2900_page_epilogue, .compress_band = ops_compress_band_hiscoa, .send_band = ops_send_band_hiscoa, @@ -396,7 +513,7 @@ static struct lbp2900_ops_s lbp3010_ops = { .job_prologue = lbp2900_job_prologue, .job_epilogue = lbp2900_job_epilogue, .page_setup = lbp2900_page_setup, - .page_prologue = lbp2900_page_prologue, + .page_prologue = lbp3010_page_prologue, .page_epilogue = lbp2900_page_epilogue, .compress_band = ops_compress_band_hiscoa, .send_band = ops_send_band_hiscoa,