精华内容
下载资源
问答
  • 从网上复制了一个以tab排版的表格,智能导入Calc很顺利,由于用的是OpenOffice打印的时候却遇到了麻烦,A4竖着打印会丢失栏目,按MSOffice下的老地方去找横向打印设置,未果,最后还是在网上找到了答案,记之备忘...

    从网上复制了一个以tab排版的表格,智能导入Calc很顺利,由于用的是OpenOffice打印的时候却遇到了麻烦,A4纸竖着打印会丢失栏目,按MS

    Office下的老地方去找横向打印设置,未果,最后还是在网上找到了答案,记之备忘:

    菜单栏->格式->页,选择页标签;纸张格式->进纸方向,选择横向。

    由于有多页,你可以在每一页都打印表头:菜单栏->格式->打印区域->编辑,在重复的行处填写行号,比如1,则表的第一行会打印在每页的第一行

    为了打印效果更美观,还可以设置表格文字居中,自动换行等等,用过Office的应该很容易找到,不再赘述。

    LQ-590K打印机过纸控制杆调节方法:

    正面面对打印机,打印机的最右侧有一个四个档位的拨杆。

    距离您最远的位置为第一档。

    第一档:放单页纸的位置。

    第二档:后进连续纸。一般情况下都是放在这个档位。

    第三档:前进连续纸。

    第四档:牵引式进纸。

    LQ-590K开启自动切纸方法:

    1、开机,并放入打印纸。

    2、同时按住“速度 (项目上)”按键和“切纸/纸槽(设定)”按键,直到打印机发出“嘟”的一声,并且“切纸/纸槽”指示灯亮。

    3、按“字体(项目下)”按键4次。每按一下之后打印机会打印一行文字,按第四下的之后会打印出自动切纸。您看后面如果写的是关,就执行下一步(第4步)。如果写的是开,就执行第5步,说明自动切纸已经是打开的状态。

    4、按“切纸/纸槽(设定)”按键1次。

    5、同时按住“速度 (项目上)”按键和“切纸/纸槽(设定)”按键,“切纸/纸槽”指示灯关闭,操作完成。

    自定义纸张方法:

    找到“设置”--“设备和打印机”,鼠标左键点击所使用的打印机图标,在上方菜单栏选择“服务器属性”,勾选“创建新表单”,在“表单名”中为输入自定义尺寸的名称(如:1234),根据纸张的实际尺寸分别输入“宽度”和“高度”(高度=连续孔数*0.5*2.54CM)。“打印机区域边距”无需修改,点击“保存格式”完成纸张自定义。

    驱动设置:

    鼠标右键点击所使用的打印机图标选择“打印首选项”->“布局”->“高级”,在“纸张规格”中选择自定义尺寸的名称“1234”

    应用软件设置:请在您所使用的应用软件中,也需要把您刚刚自定义的纸张规格选择出来。第一步:启动Internet浏览器,进入互联网正常浏览或脱机浏览。

    第二步:移动鼠标到菜单栏,单击“文件”一“打印”。

    第三步:在出现的“打印”对话框中根据需要设置打印参数。

    第四步:单击“确定”,打印整个网页。

    [方法二]

    第一步:启动Internet浏览器,进入互联网正常浏览或脱机浏览。

    第二步:移动鼠标到要打印内容的起始处,按下鼠标左键不要松开。

    第三步:拖动鼠标至要打印内容的结尾处放开左键,选中打印内容。

    第四步:移动鼠标到选中内容处右健单击,从出现的菜单中单击选中“打印”。

    第五步:在出现的“打印”对话框中根据需要设置打印参数。

    第六步:单击“确定”,打印当前网页所选中的内容。

    展开全文
  • 用java写了一个打印机,遇到打印纸张输出的问题,打印纸张有A4或者A5,当设置A5纸张的时候需要横向打印输出下面贴出部分代码,用于解决当打印纸张为A5纸张时,文件横向打印DocPrintJob jon = printService....

    用java写了一个打印机,遇到打印纸张输出的问题,打印纸张有A4或者A5,当设置A5纸张的时候需要横向打印输出

    下面贴出部分代码,用于解决当打印纸张为A5纸张时,文件横向打印

    DocPrintJob jon = printService.createPrintJob();

    // 设置纸张大小,也可以新建MediaSize类来自定义大小

    // 文件类型

    DocFlavor flavor = DocFlavor.INPUT_STREAM.JPEG;

    PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();

    DocAttributeSet das = new HashDocAttributeSet();//打印属性设置

    switch (paperSize){

    case "A4":

    pras.add(MediaSizeName.ISO_A4);  //A4默认

    das.add(OrientationRequested.PORTRAIT);//(文件的)竖向的;纵向打印格式的

    break;

    case "A5":

    pras.add(MediaSizeName.ISO_A5);    //A5横向打印

    das.add(OrientationRequested.LANDSCAPE);//(文件的)横向打印格式

    break;

    default:

    pras.add(MediaSizeName.ISO_A4);  //A4默认

    das.add(OrientationRequested.PORTRAIT);//(文件的)竖向的;纵向打印格式的

    }

    Doc doc = new SimpleDoc(swapStream,flavor,das);

    jon.print(doc,pras);

    展开全文
  • SAP打印机自定义纸张设置;本地打印机设置打印池满了的处理方法;SMARTFORMS超大字体大小设置
  • Printer 对象常数 打印机颜色模式 常数 值 描述 ...vbPRCMMonochrome 1 单色输出 ...双面打印 ...vbPRDPSimplex 1 单面...vbPRDPHorizontal 2 双面水平打印 vbPRDPVertical 3 双面垂直打印 打印方向 常数 值 描

    Printer 对象常数

    打印机颜色模式

    常数 值 描述

    vbPRCMMonochrome 1 单色输出

    vbPRCMColor 2 彩色输出

    双面打印

    常数 值 描述

    vbPRDPSimplex 1 单面打印

    vbPRDPHorizontal 2 双面水平打印

    vbPRDPVertical 3 双面垂直打印

    打印方向

    常数 值 描述

    vbPRORPortrait 1 文档打印以纸的窄边作顶部

    vbPRORLandscape 2 文档打印以纸的宽边作顶部

    打印质量

    常数 值 描述

    vbPRPQDraft -1 草稿打印质量

    vbPRPQLow -2 低级打印质量

    vbPRPQMedium -3 中等打印质量

    vbPRPQHigh -4 高级打印质量

    PaperBin 属性

    常数 值 描述

    vbPRBNUpper 1 从上层纸盒进纸

    vbPRBNLower 2 从下层纸盒进纸

    vbPRBNMiddle 3 从中间纸盒进纸

    vbPRBNManual 4 等待手动插入每页纸

    vbPRBNEnvelope 5 从信封进纸器进纸

    vbPRBNEnvManual 6 从信封进纸器进纸;但要等待手动插入

    vbPRBNAuto 7 (缺省方式)从当前缺省纸盒进纸

    vbPRBNTractor 8 从拖拉进纸器供纸

    vbPRBNSmallFmt 9 从小型进纸器进纸

    vbPRBNLargeFmt 10 从大型纸盒进纸

    vbPRBNLargeCapacity 11 从大容量进纸器进纸

    vbPRBNCassette 14 从附加的卡式纸盒进纸

    PaperSize 属性

    常数 值 描述

    vbPRPSLetter 1 信笺, 8 1/2 x 11 英寸

    vbPRPSLetterSmall 2 +A611 小型信笺, 8 1/2 x 11 英寸

    vbPRPSTabloid 3 小型报, 11 x 17 英寸

    vbPRPSLedger 4 分类帐, 17 x 11 英寸

    vbPRPSLegal 5 法律文件, 8 1/2 x 14 英寸

    vbPRPSStatement 6 声明书,5 1/2 x 8 1/2 英寸

    vbPRPSExecutive 7 行政文件,7 1/2 x 10 1/2 英寸

    vbPRPSA3 8 A3, 297 x 420 mm

    vbPRPSA4 9 A4, 210 x 297 mm

    vbPRPSA4Small 10 A4小号, 210 x 297 mm

    vbPRPSA5 11 A5, 148 x 210 mm

    vbPRPSB4 12 B4, 250 x 354 mm

    vbPRPSB5 13 B5, 182 x 257 mm

    vbPRPSFolio 14 对开本, 8 1/2 x 13 英寸

    vbPRPSQuarto 15 四开本, 215 x 275 mm

    vbPRPS1&H14 16 10 x 14 英寸

    vbPRPS11x17 17 11 x 17 英寸

    vbPRPSNote 18 便条,8 1/2 x 11 英寸

    vbPRPSEnv9 19 #9 信封, 3 7/8 x 8 7/8 英寸

    vbPRPSEnv10 20 #10 信封, 4 1/8 x 9 1/2 英寸

    vbPRPSEnv11 21 #11 信封, 4 1/2 x 10 3/8 英寸

    vbPRPSEnv12 22 #12 信封, 4 1/2 x 11 英寸

    vbPRPSEnv14 23 #14 信封, 5 x 11 1/2 英寸

    vbPRPSCSheet 24 C 尺寸工作单

    vbPRPSDSheet 25 D 尺寸工作单

    vbPRPSESheet 26 E 尺寸工作单

    vbPRPSEnvDL 27 DL 型信封, 110 x 220 mm

    vbPRPSEnvC3 29 C3 型信封, 324 x 458 mm

    vbPRPSEnvC4 30 C4 型信封, 229 x 324 mm

    vbPRPSEnvC5 28 C5 型信封, 162 x 229 mm

    vbPRPSEnvC6 31 C6 型信封, 114 x 162 mm

    vbPRPSEnvC65 32 C65 型信封,114 x 229 mm

    vbPRPSEnvB4 33 B4 型信封, 250 x 353 mm

    vb

    PRPSEnvB5 34 B5 型信封,176 x 250 mm

    vbPRPSEnvB6 35 B6 型信封, 176 x 125 mm

    vbPRPSEnvItaly 36 信封, 110 x 230 mm

    vbPRPSEnvMonarch 37 信封大王, 3 7/8 x 7 1/2 英寸

    vbPRPSEnvPersonal 38 信封, 3 5/8 x 6 1/2 英寸

    vbPRPSFanfoldUS 39 U.S. 标准复写簿, 14 7/8 x 11 英寸

    vbPRPSFanfoldStdGerman 40 德国标准复写簿, 8 1/2 x 12 英寸

    vbPRPSFanfoldLglGerman 41 德国法律复写簿, 8 1/2 x 13 英寸

    vbPRPSUser 256 用户定义

    vb6 设置打印机纸张类型,以及打印方向[转]2008-08-08 18:02:13| 分类: vc 学习 | 标签:无 |字号大中小 订阅 .

    这段时间在做一个报表系统,其中在批量打印的时候需要自动设置打印纸张和打印方向,这就需要在打印前控制打印机,对其进行设置.整了半天,终于整出来一个打印模块,直接控制打印机对其进行设置

    '--------------------------------------------------------------------------------

    ' 版本号 : Ver1.0

    ' 功能 : 设置打印机纸张类型,以及打印方向

    '--------------------------------------------------------------------------------

    Option Explicit

    Private Const CCHDEVICENAME = 32

    Private Const CCHFORMNAME = 32

    '控制打印机权限

    Private Const STANDARD_RIGHTS_REQUIRED = &HF0000

    Private Const PRINTER_ACCESS_ADMINISTER = &H4

    Private Const PRINTER_ACCESS_USE = &H8

    Private Const PRINTER_ALL_ACCESS = PRINTER_ACCESS_USE

    'Constants used to make changes to the values contained in the DevMode

    Private Const DM_MODIFY = 8

    Private Const DM_IN_BUFFER = DM_MODIFY

    Private Const DM_COPY = 2

    Private Const DM_OUT_BUFFER = DM_COPY

    Private Const DM_DUPLEX = &H1000&

    '打印机送纸方向

    Private Const DMDUP_SIMPLEX = 1

    Private Const DMDUP_VERTICAL = 2

    Private Const DMDUP_HORIZONTAL = 3

    Private Const DM_ORIENTATION = &H1&

    Private Const DM_PAPERSIZE = &H2&

    Private Type DEVMODE

    dmDeviceName As String * CCHDEVICENAME

    dmSpecVersion As Integer

    dmDriverVersion As Integer

    dmSize As Integer

    dmDriverExtra As Integer

    dmFields As Long

    dmOrientation As Integer

    dmPaperSize As Integer

    dmPaperLength As Integer

    dmPaperWidth As Integer

    dmScale As Integer

    dmCopies As Integer

    dmDefaultSource As Integer

    dmPrintQuality As Integer

    dmColor As Integer

    dmDuplex As Integer

    dmYResolution As Integer

    dmTTOption As Integer

    dmCollate As Integer

    dmFormName As String * CCHFORMNAME

    dmLogPixels As Integer

    dmBitsPerPel As Long

    dmPelsWidth As Long

    dmPelsHeight As Long

    dmDisplayFlags As Long

    dmDisplayFrequency As Long

    dmICMMethod As Long ' //

    仅供Win95

    dmICMIntent As Long ' // 仅供Win95

    dmMediaType As Long ' // 仅供Win95

    dmDitherType As Long ' // 仅供Win95

    dmReserved1 As Long ' // 仅供Win95

    dmReserved2 As Long ' // 仅供Win95

    End Type

    '打印机使用初始化结构体

    Private Type PRINTER_DEFAULTS

    pDataType As String

    pDevMode As Long

    DesiredAccess As Long

    End Type

    Enum PageDirection

    纵向打印 = 1

    横向打印 = 2

    End Enum

    '打印机控制API

    Private Declare Function OpenPrinter Lib "winspool.drv" Alias _

    "OpenPrinterA" (ByVal pPrinterName As String, _

    phPrinter As Long, _

    pDefault As PRINTER_DEFAULTS) As Long

    Private Declare Function SetPrinter Lib "winspool.drv" Alias _

    "SetPrinterA" (ByVal hPrinter As Long, _

    ByVal Level As Long, _

    pPrinter As Any, _

    ByVal Command As Long) As Long

    Private Declare Function GetPrinter Lib "winspool.drv" Alias _

    "GetPrinterA" (ByVal hPrinter As Long, ByVal Level As Long, _

    pPrinter As Any, _

    ByVal cbBuf As Long, _

    pcbNeeded As Long) As Long

    Private Declare Sub CopyMemory Lib "kernel32" Alias _

    "RtlMoveMemory" (hpvDest As Any, _

    hpvSource As Any, _

    ByVal cbCopy As Long)

    Private Declare Function ClosePrinter Lib "winspool.drv" (ByVal hPrinter As Long) As Long

    Private Declare Function DocumentProperties Lib "winspool.drv" Alias _

    "DocumentPropertiesA" (ByVal hWnd As Long, _

    ByVal hPrinter As Long, _

    ByVal pDeviceName As String, _

    ByVal pDevModeOutput As Any, _

    ByVal pDevModeInput As Any, _

    ByVal fMode As Long) As Long

    '--------------------------------------------------------------------------------

    ' 程序: SetPrintStyle

    ' 描述: 控制打印机设置打印机进纸类型,以及打印方向

    ' 参数: orientationConsts (PageDirection) 打印方向,1=纵向打印,2=横向打印

    ' Int_PaperSize (Integer = 9) 默认打印A4,A3=8,A5=11,B4=12,B5=13

    '--------------------------------------------------------------------------------

    Public Function SetPrintStyle(OrientationConsts As PageDirection, _

    Optional ByVal Int_PaperSize As Integer = 9) As Boolean

    Dim PrinterHandle As Long

    Dim PrinterName As String

    Dim pd As PRINTER_DEFAULTS

    Dim MyDevMode As DEVMODE

    Dim Result As Long

    Dim Needed As Long

    Dim pFullDevMode As Long

    Dim pi2_buffer() As Long

    PrinterName = Printer.DeviceName

    If PrinterName = "" Then

    Exit Function

    End If

    pd.pDataType = vbNullString

    pd.pDevMode = 0&

    pd.DesiredAccess = PRINTER_ALL_ACCESS

    Result = OpenPrinter(PrinterName, PrinterHandle, pd)

    If Result = 0 Then Exit Function

    Result = GetPrinter(PrinterHandle, 2, ByVal 0&, 0, Needed)

    ReDim pi2_buffer((Needed \ 4))

    Result = GetPrinter(PrinterHandle, 2, pi2_buffer(0), Needed, Needed)

    If Result = 0 Then Exit Function

    pFullDevMode = pi2_buffer(7)

    Call CopyMemory(MyDevMode, ByVal pFullDevMode, Len(MyDevMode))

    MyDevMode.dmFormName = orientationConsts

    MyDevMode.dmOrientation = orientationConsts

    MyDevMode.dmFields = DM_ORIENTATION

    MyDevMode.dmFields = MyDevMode.dmFields or DM_PAPERSIZE

    MyDevMode.dmPaperSize = Int_PaperSize

    Call CopyMemory(ByVal pFullDevMode, MyDevMode, Len(MyDevMode))

    Result = DocumentProperties(0&, _

    PrinterHandle, PrinterName, _

    ByVal pFullDevMode, _

    ByVal pFullDevMode, _

    DM_IN_BUFFER or DM_OUT_BUFFER)

    Result = SetPrinter(PrinterHandle, 2, pi2_buffer(0), 0&)

    Call ClosePrinter(PrinterHandle)

    Erase pi2_buffer

    SetPrintStyle = True

    End Function

    我已经说过多遍关于这个问题了

    如果想自定义纸张的话就用这个。

    Printer.PaperSize = 256 '设置纸张为自定义纸张

    Printer.PaperHeight = 9.3 * 567 '设置纸张的高度

    Printer.PaperWidth = 18.9 * 567 '设置纸张的宽度

    Prin

    ter.Orientation = ddOPortrait '设置纸张是横向还是竖向打印,此项为横向打印。

    对我有用[0] 丢个板砖[0] 引用 举报 管理 TOP 精华推荐:讨论:浅谈winsock ConnectionRequest事件

    dbcontrols

    (自己)

    等 级:

    2

    8

    #2楼 得分:0回复于:2002-02-08 08:19:33Dim m_PaperSize As String

    Private Enum PrinterOrientationConstants

    OrientPortrait = 1

    OrientLandscape = 2

    End Enum

    Private Type DEVMODE

    dmDeviceName As String * 32

    dmSpecVersion As Integer

    dmDriverVersion As Integer

    dmSize As Integer

    dmDriverExtra As Integer

    dmFields As Long

    dmOrientation As Integer

    dmPaperSize As Integer

    dmPaperLength As Integer

    dmPaperWidth As Integer

    dmScale As Integer

    dmCopies As Integer

    dmDefaultSource As Integer

    dmPrintQuality As Integer

    dmColor As Integer

    dmDuplex As Integer

    dmYResolution As Integer

    dmTTOption As Integer

    dmCollate As Integer

    dmFormName As String * 32

    dmUnusedPadding As Integer

    dmBitsPerPel As Integer

    dmPelsWidth As Long

    dmPelsHeight As Long

    dmDisplayFlags As Long

    dmDisplayFrequency As Long

    End Type

    Private Type PRINTER_DEFAULTS

    pDataType As String

    pDevMode As Long

    DesiredAccess As Long

    End Type

    Private Type PRINTER_INFO_2

    pServerName As Long

    pPrinterName As Long

    pShareName As Long

    pPortName As Long

    pDriverName As Long

    pComment As Long

    pLocation As Long

    pDevMode As Long

    pSepFile As Long

    pPrintProcessor As Long

    pDataType As Long

    pParameters As Long

    pSecurityDescriptor As Long

    Attributes As Long

    Priority As Long

    DefaultPriority As Long

    StartTime As Long

    UntilTime As Long

    Status As Long

    cJobs As Long

    AveragePPM As Long

    End Type

    Private Const DMPAPER_A2 = 66

    Private Const DMPAPER_A3 = 8

    Private Const DMPAPER_A4 = 9

    Private Const DMPAPER_A5 = 11

    Private Const DMPAPER_B4

    = 12

    Private Const DMPAPER_B5 = 13

    Private Const DMPAPER_USER = 256

    Private Const DM_IN_BUFFER As Long = 8

    Private Const DM_OUT_BUFFER As Long = 2

    Private Const DM_ORIENTATION As Long = &H1

    Private Const DM_PAPERSIZE = &H2&

    Private Const PRINTER_ACCESS_ADMINISTER As Long = &H4

    Private Const PRINTER_ACCESS_USE As Long = &H8

    Private Const STANDARD_RIGHTS_REQUIRED As Long = &HF0000

    Private Const PRINTER_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED Or PRINTER_ACCESS_ADMINISTER Or PRINTER_ACCESS_USE)

    Private Declare Sub CopyMemory Lib "kernel32 " Alias "RtlMoveMemory " (hpvDest As Any, hpvSource As Any, ByVal cbCopy As Long)

    Private Declare Function OpenPrinter Lib "winspool.drv " Alias "OpenPrinterA " (ByVal pPrinterName As String, phPrinter As Long, pDefault As Any) As Long

    Private Declare Function ClosePrinter Lib "winspool.drv " (ByVal hPrinter As Long) As Long

    Private Declare Function DocumentProperties Lib "winspool.drv " Alias "DocumentPropertiesA " (ByVal hwnd As Long, ByVal hPrinter As Long, ByVal pDeviceName As String, pDevModeOutput As Any, pDevModeInput As Any, ByVal fMode As Long) As Long

    Private Declare Function GetPrinter Lib "winspool.drv " Alias "GetPrinterA " (ByVal hPrinter As Long, ByVal Level As Long, pPrinter As Any, ByVal cbBuf As Long, pcbNeeded As Long) As Long

    Private Declare Function SetPrinter Lib "winspool.drv " Alias "SetPrinterA " (ByVal hPrinter As Long, ByVal Level As Long, pPrinter As Any, ByVal Command As Long) As Long

    Private Function SetDefaultPrinterOrientation(ByVal eOrientation As _

    PrinterOrientationConstants) As Boolean

    Dim bDevMode() As Byte

    Dim bPrinterInfo2() As Byte

    Dim hPrinter As Long

    Dim lResult As Long

    Dim nSize As Long

    Dim sPrnName As String

    Dim dm As DEVMODE

    Dim pd As PRINTER_DEFAULTS

    Dim pi2 As PRINTER_INFO_2

    ' 获取默认打印机的设备名称

    sPrnName = Printer.DeviceName

    ' 由于要调用SetPrinter,所以

    ' 如果是在NT下就要求PRINTER_ALL_ACCESS

    pd.DesiredAccess = PRINTER_ALL_ACCESS

    ' 获取打印机句柄

    If OpenPrinter(sPrnName, hPrinter, pd) Then

    ' 获取PRINTER_INFO_2结构要求的字节数

    Call GetPrinter(hPrinter, 2&, 0&, 0&

    , nSize)

    ReDim bPrinterInfo2(1 To nSize) As Byte

    lResult = GetPrinter(hPrinter, 2, bPrinterInfo2(1), nSize, nSize)

    Call CopyMemory(pi2, bPrinterInfo2(1), Len(pi2))

    nSize = DocumentProperties(0&, hPrinter, sPrnName, 0&, 0&, 0)

    ReDim bDevMode(1 To nSize)

    If pi2.pDevMode Then

    Call CopyMemory(bDevMode(1), ByVal pi2.pDevMode, Len(dm))

    Else

    Call DocumentProperties(0&, hPrinter, sPrnName, bDevMode(1), 0&, DM_OUT_BUFFER)

    End If

    Call CopyMemory(dm, bDevMode(1), Len(dm))

    With dm

    ' 设置新的走向

    .dmOrientation = eOrientation

    .dmFields = DM_ORIENTATION

    Select Case UCase(PaperSize)

    Case "A2 "

    .dmPaperSize = DMPAPER_A2 ' 将纸张大小设为A5,请自行更改所需大小

    Case "A3 "

    .dmPaperSize = DMPAPER_A3

    Case "A4 "

    .dmPaperSize = DMPAPER_A4

    Case "A5 "

    .dmPaperSize = DMPAPER_A5

    Case "B4 "

    .dmPaperSize = DMPAPER_B4

    Case "B5 "

    .dmPaperSize = DMPAPER_B5

    Case "自定义 "

    .dmPaperSize = DMPAPER_USER

    End Select

    .dmFields = DM_PAPERSIZE ' 必须,否则无法设置纸张大小

    End With

    Call CopyMemory(bDevMode(1), dm, Len(dm))

    Call DocumentProperties(0&, hPrinter, sPrnName, _

    bDevMode(1), bDevMode(1), DM_IN_BUFFER Or _

    DM_OUT_BUFFER)

    pi2.pDevMode = VarPtr(bDevMode(1))

    lResult = SetPrinter(hPrinter, 2, pi2, 0&)

    Call ClosePrinter(hPrinter)

    SetDefaultPrinterOrientation = True

    Else

    SetDefaultPrinterOrientation = False

    End If

    对我有用[0] 丢个板砖[0] 引用 举报 管理 TOP 精华推荐:【塞北雪貂】我这十年之回忆录

    northlights

    (北极之光)

    等 级:

    #3楼 得分:0回复于:2002-02-08 14:27:10MSDN

    对我

    有用[0] 丢个板砖[0] 引用 举报 管理 TOP 精华推荐:VB变态应用活动:我最近写的FlashBit。

    xxlroad

    (土八路)

    等 级:

    #4楼 得分:0回复于:2002-02-08 17:11:35收

    对我有用[0] 丢个板砖[0] 引用 举报 管理 TOP 精华推荐:【评选】版内活动:挖掘VB潜能,征集变态应用

    lihonggen0

    (李洪根,MS MVP,标准答案)

    等 级:

    6

    更多勋章 #5楼 得分:0回复于:2002-03-01 14:08:50Option Explicit

    Public Enum PrinterOrientationConstants

    OrientPortrait = 1

    OrientLandscape = 2

    End Enum

    Private Type DEVMODE

    dmDeviceName As String * 32

    dmSpecVersion As Integer

    dmDriverVersion As Integer

    dmSize As Integer

    dmDriverExtra As Integer

    dmFields As Long

    dmOrientation As Integer

    dmPaperSize As Integer

    dmPaperLength As Integer

    dmPaperWidth As Integer

    dmScale As Integer

    dmCopies As Integer

    dmDefaultSource As Integer

    dmPrintQuality As Integer

    dmColor As Integer

    dmDuplex As Integer

    dmYResolution As Integer

    dmTTOption As Integer

    dmCollate As Integer

    dmFormName As String * 32

    dmUnusedPadding As Integer

    dmBitsPerPel As Integer

    dmPelsWidth As Long

    dmPelsHeight As Long

    dmDisplayFlags As Long

    dmDisplayFrequency As Long

    End Type

    Private Type PRINTER_DEFAULTS

    pDatatype As String

    pDevMode As Long

    DesiredAccess As Long

    End Type

    Private Type PRINTER_INFO_2

    pServerName As Long

    pPrinterName As Long

    pShareName As Long

    pPortName As Long

    pDriverName As Long

    pComment As Long

    pLocation As Long

    pDevMode As Long

    pSepFile As Long

    pPrintProcessor As Long

    pDatatype As Long

    pParameters As Long

    pSecurityDescriptor As Long

    Attributes As Long

    Priority As Long

    DefaultPriority As Long

    StartTime As Long

    UntilTime As Long

    Status As Long

    cJobs As Long

    AveragePPM As Long

    End Type

    '******************* '

    ' iDmpaper值 纸张 '

    ' 11 A5 '

    ' 13 B5 '

    '******************* '

    Private Const DM_IN_BUFFER As Long = 8

    Private Const DM_OUT_BUFFER As Long = 2

    Private Const DM_ORIENTATION As Long = &H1

    Private Const DM_PAPERSIZE = &H2&

    Private Const PRINTER_ACCESS_ADMINISTER As Long

    = &H4

    Private Const PRINTER_ACCESS_USE As Long = &H8

    Private Const STANDARD_RIGHTS_REQUIRED As Long = &HF0000

    Private Const PRINTER_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED _

    Or _

    PRINTER_ACCESS_ADMINISTER Or PRINTER_ACCESS_USE)

    Private Declare Sub CopyMemory Lib "kernel32 " Alias _

    "RtlMoveMemory " _

    (hpvDest As Any, hpvSource As Any, ByVal _

    cbCopy As Long)

    Private Declare Function OpenPrinter Lib "winspool.drv " Alias _

    "OpenPrinterA " (ByVal pPrinterName As String, phPrinter As _

    Long, pDefault As Any) As Long

    Private Declare Function ClosePrinter Lib "winspool.drv " _

    (ByVal hPrinter As Long) As Long

    Private Declare Function DocumentProperties Lib "winspool.drv " _

    Alias "DocumentPropertiesA " (ByVal hwnd As Long, ByVal hPrinter _

    As Long, _

    ByVal pDeviceName As String, pDevModeOutput As _

    Any, _

    pDevModeInput As Any, _

    ByVal fMode As Long) As Long

    Private Declare Function GetPrinter Lib "winspool.drv " _

    Alias "GetPrinterA " (ByVal hPrinter As Long, ByVal Level As Long, _

    pPrinter As Any, ByVal cbBuf As Long, pcbNeeded As Long) As _

    Long

    Private Declare Function SetPrinter Lib "winspool.drv " _

    Alias "SetPrinterA " (ByVal hPrinter As Long, ByVal Level As Long, _

    pPrinter As Any, ByVal Command As Long) As Long

    '在打印或预览之前直接调用SetDefaultPrinterOrientation 打印走向常数。注意:红色注释部分用于改变纸张的大小。

    Function SetDefaultPrinterOrientation(ByVal eOrientation As _

    PrinterOrientationConstants, iDmpaper As Integer) As Boolean

    Dim bDevMode() As Byte

    Dim bPrinterInfo2() As Byte

    Dim hPrinter As Long

    Dim lResult As Long

    Dim nSize As Long

    Dim sPrnName As String

    Dim dm As DEVMODE

    Dim olddm As DEVMODE

    Dim pd As PRINTER_DEFAULTS

    Dim pi2 As PRINTER_INFO_2

    ' 获取默认打印机的设备名称

    sPrnName = Printer.DeviceName

    ' 由于要调用SetPrinter,所以

    ' 如果是在NT下就要求PRINTER_ALL_ACCESS

    pd.DesiredAccess = PRINTER_ALL_ACCESS

    ' 获取打印机句柄

    If OpenPrinter(sPrnName, hPrinter, pd) Then

    ' 获取PRINTER_INFO_2结构要求的字节数

    Call GetPrinter(hPrinter, 2&, 0&, 0&, nSize)

    ReDim bPrinterInfo

    2(1 To nSize) As Byte

    lResult = GetPrinter(hPrinter, 2, bPrinterInfo2(1), nSize, nSize)

    Call CopyMemory(pi2, bPrinterInfo2(1), Len(pi2))

    nSize = DocumentProperties(0&, hPrinter, sPrnName, 0&, 0&, 0)

    ReDim bDevMode(1 To nSize)

    If pi2.pDevMode Then

    Call CopyMemory(bDevMode(1), ByVal pi2.pDevMode, Len(dm))

    Else

    Call DocumentProperties(0&, hPrinter, sPrnName, bDevMode(1), 0&, DM_OUT_BUFFER)

    End If

    Call CopyMemory(dm, bDevMode(1), Len(dm))

    Call CopyMemory(olddm, bDevMode(1), Len(olddm))

    With dm

    ' 设置新的走向

    .dmOrientation = eOrientation

    .dmFields = DM_ORIENTATION

    .dmPaperSize = iDmpaper '将纸张大小设为iDmpaper,请自行更改所需大小

    ' .dmPaperLength = iDmpaperLength

    ' .dmPaperWidth = iDmpaperWidth

    .dmFields = DM_PAPERSIZE '必须,否则无法设置纸张大小

    End With

    Call CopyMemory(bDevMode(1), dm, Len(dm))

    Call DocumentProperties(0&, hPrinter, sPrnName, _

    bDevMode(1), bDevMode(1), DM_IN_BUFFER Or _

    DM_OUT_BUFFER)

    pi2.pDevMode = VarPtr(bDevMode(1))

    lResult = SetPrinter(hPrinter, 2, pi2, 0&)

    Call ClosePrinter(hPrinter)

    SetDefaultPrinterOrientation = True

    Else

    SetDefaultPrinterOrientation = False

    End If

    End Function


    展开全文
  • 本程序为一个测试程序,主要测试ModifyPageSetting.dll的功能。 ModifyPageSetting.dll没有上传源码,有需要给我空间留言。 ModifyPageSetting.dll真实可用,使用方法见测试程序 ...获取打印纸名称,获取当前打印方向
  • 本成员设置打印纸类型,可以为以下常量值之一: 0、#默认纸; 1、#A3纸(297x420毫米); 2、#A4纸(210x297毫米); 3、#A5纸(148x210毫米); 4、#B4纸(250x354毫米); 5、#B5纸(182x257毫米); 6、#四开(215x275毫米.....

    成员“纸张类型”所在数据类型为“打印设置信息”,英文名称为“Paper”,类型为“整数型(int)”,初始值为“0”。

    本成员设置打印纸类型,可以为以下常量值之一: 0、#默认纸; 1、#A3纸(297x420毫米); 2、#A4纸(210x297毫米); 3、#A5纸(148x210毫米); 4、#B4纸(250x354毫米); 5、#B5纸(182x257毫米); 6、#四开(215x275毫米); 7、#十六开(146x215毫米); 8、#三十二开(97x151毫米); 9、#信纸(216x279毫米); 10、#法律用纸(216x355毫米); 11、#行政用纸(184x266毫米); 12、#声明(140x216毫米); 13、#小报(279x432毫米); 14、#笔记(216x279毫米); 15、#帐本(432x279毫米); 16、#对开纸(216x330毫米)。

    除了以上基本类型纸张,还支持以下扩展类型,这些类型值和其所对应纸张宽度与高度(单位毫米)列表如下:

    1001: 216x279

    1002: 279x432

    1003: 432x279

    1004: 216x355

    1005: 140x216

    1006: 184x267

    1007: 297x420

    1008: 210x297

    1010: 148x210

    1011: 257x364

    1012: 182x257

    1013: 216x330

    1014: 215x275

    1015: 254x355

    1016: 279x432

    1017: 216x279

    1018: 98x225

    1019: 105x241

    1020: 114x263

    1021: 121x279

    1022: 127x292

    1023: 432x558

    1024: 558x863

    1025: 863x1117

    1026: 110x220

    1027: 162x229

    1028: 324x458

    1029: 229x324

    1030: 114x162

    1031: 114x229

    1032: 250x353

    1033: 176x250

    1034: 176x125

    1035: 110x230

    1036: 98x190

    1037: 92x165

    1038: 378x279

    1039: 216x305

    1040: 216x330

    1041: 250x353

    1042: 100x148

    1043: 228x279

    1044: 254x279

    1045: 381x279

    1046: 220x220

    1049: 241x305

    1050: 241x381

    1051: 305x457

    1052: 235x322

    1053: 216x279

    1054: 210x297

    1055: 241x305

    1056: 227x356

    1057: 305x487

    1058: 216x322

    1059: 210x330

    1060: 148x210

    1061: 182x257

    1062: 322x445

    1063: 174x235

    1064: 201x276

    1065: 420x594

    1066: 297x420

    1067: 322x445

    1068: 200x148

    1069: 105x148

    1070: 240x332

    1071: 216x277

    1072: 120x235

    1073: 90x205

    1074: 279x216

    1075: 420x297

    1076: 297x210

    1077: 210x148

    1078: 364x257

    1079: 257x182

    1080: 148x100

    1081: 148x200

    1082: 148x105

    1083: 332x240

    1084: 277x216

    1085: 235x120

    1086: 205x90

    1087: 128x182

    1088: 182x128

    1089: 305x279

    1090: 105x235

    1091: 235x105

    1092: 188x260

    1093: 130x184

    1094: 140x203

    1095: 102x165

    1096: 102x176

    1097: 125x176

    1098: 110x208

    1099: 110x220

    1100: 120x230

    1101: 160x230

    1102: 120x309

    1103: 229x324

    1104: 324x458

    1105: 260x188

    1106: 184x130

    1107: 203x140

    1108: 165x102

    1109: 176x102

    1110: 176x125

    1111: 208x110

    1112: 220x110

    1113: 230x120

    1114: 230x160

    1115: 309x120

    1116: 324x229

    1117: 458x324

    注意如果所选择纸张得不到打印机的支持,打印机将会自动选择最接近的纸张。

    展开全文
  • 我正在使用以下代码来打印包含文本和图像的HTML内容.if (![UIPrintInteractionController isPrintingAvailable]) {UIAlertView *alertView = [[[UIAlertView alloc]initWithTitle:NSLocalizedString(@"Printer ...
  • 导语:聊到针式打印机,大家应该都不陌生,有朋友问三联打印纸 如何设置打印机纸张规格,另外,还有朋友想问格志针式打印机怎么调纸张,这到底怎么回事呢?事实上爱普生针式打印机lq-680k呢,今天给大家说说针式...
  • 如何在sap里设置自定义打印纸张

    千次阅读 2018-11-11 08:45:26
    如何在sap里设置自定义打印纸张
  • 那么,中琅领跑条码标签打印软件最新V6版中,是怎么自定义设置标签的纸张尺寸呢? 本文我们以一排三列的31*19,间距2,左右边距为1的不干胶标签为例。 在中琅条码打印软件左上角工具栏点击“新建”-“文档...
  • 最常用到的卷纸标签一般有单排(一列)或者多排(多列),在打印的时候经常会出现这样或那样的问题,很多是因为标签尺寸设置不准造成,本文我们以卷纸单排标签为例看一下在中琅条码标签打印软件中如何设置: ...
  • 例如,设置为A4,但实际没有这种类型的纸张,或者有名称不一样,偶尔会导致即使设置了横向,但实际打印依然是纵向。也就是横向设置不起作用。 private PaperSize GetPaperSize(PrintDocument pDoc, string ...
  • 我需要能够从qt( QGraphicsScene 或 QImage 的渲染内容)进行打印,以便在普通打印机,pdf上进行缩放,也可以在 custom 打印机上进行缩放,包括滚动输入 .似乎任何适用于标准打印机的东西都会在自定义打印机上失败,...
  • 集成导入地图和打印布局视图由于之前没有问清楚 导入栅格还是SHP 就只做了导入SHP的 后来说要两个都可以导入 于是想到了工具栏中的十字型导入数据的工具,打开后是这样的:就想着能不能自己实现一个所有数据类型都能...
  • 关于PB打印设置中纸张的大小 原创Linux操作系统作者:coolhe时间:2009-09-02 11:26:3059300 http://blog.itpub.net/3090/viewspace-613776/ PB打印设置中纸张大小的设置方法: dw...
  • 在很多是时候往往要打印网页中的某一部分,而不是全部网页,所以告诉打印机要打印的部分,使用css进行一下设置是一个比较好的方式,先看一段代码:复制代码代码如下:以上两行代码是引入外部css样式表,需要特别主义的...
  • 正常我们打印都是使用A4的,但是有朋友需要打印16开大小的纸张,但是却不清楚16开到底是多大?也不知道打印机要如何设置16开纸张?可把用户愁怀了,其实设置方法很简单,下面请随小编一起来看看吧!具体如下:一、...
  • 这篇文章介绍如何在Java应用程序中打印PDF文档以及进行一些打印设置,包括指定打印机、自定义纸张大小、设置打印参数、以及显示打印对话框等。 导入jar文件 本文所使用的PDF类库是Spire.PDF for Java, 如果你的...
  • 浏览器如何设置默认打印机的纸张类型 浏览器默认打印时是A4打印纸,但是软件大多使用自定义纸张类型, ...答案是修改打印机的默认纸张类型为自定义类型即可,下面说说如何设置打印纸的默认纸张类型
  • 使用@page规则可以对打印进行更多的设置,比如指定页面的尺寸。页边 距,页眉页脚等,以求达到更好的效果。下面做一下简单介绍。一.纸张大小设置:@page {size: 5.5in 8.5in;}设置纸张大小,5.5英寸宽,8.5英寸高。@page...
  •  要恢复与一个 Visual FoxPro 报表关联的数据环境,请设置数据环境的AutoOpenTables 属性为真(.T.) (默认值)。要确保报表运行结束时报表环境被关闭,请设置数据环境的AutoCloseTables 属性为真(.T.) (默认值)。更多...
  • 在sap系统设置纸张打印格式

    千次阅读 2017-02-15 14:42:23
    在sap做一个打印报表,要先设置一个纸张打印格式,下面以工厂中常用来打印的针孔为例,在sap设置该纸张的打印格式,以用于报表:  1、运行事务代码SPAD;选择工具栏上的【完全管理】按钮-->选择【设备类型】...
  • C# 自定义纸张大小打印 PDF

    千次阅读 2018-07-31 17:26:55
    打印PDF文档的时候,默认情况下纸张大小是A4。但是有些情况下原文档不是A4大小,我们需要保持原来的页面大小怎么办呢?这个时候就需要自定义纸张大小来实现这个功能。本文将介绍如何使用.NET PDF组件Spire.PDF在C#...
  • SAP自带国际标准类型,如A3、A4、A5等,但是实际应用中可能会碰到...定义好页和格式类型,还需要把页和格式分配给指定的设备类型,SAP的打印属于假脱机操作,需要指定输出设备的,每个设备都需要设定类型打印的时...
  • 具体操作步骤如下:1....2.单击并从纸张方向弹出的选项中选择“3....2.如何将打印设置为横向打印 操作方法如下:1.打开excel文件表单2.此时,所有工作表都需要水平打印。有两个工作表,如下图所示3.单击鼠标右键并选择“...
  • 在sap做一个打印报表,要先设置一个纸张打印格式,下面以工厂中常用来打印的针孔为例,在sap设置该纸张的打印格式,以用于报表: 1、运行事务代码SPAD;选择工具栏上的【完全管理】按钮——>选择【设备...
  • 条码标签,顾名思义是打印或印刷了条形码的标签。大多数的应用情况是要求每个条形码的号码都是唯一的。条码标签是日常生活中随处可见的纸品,广泛应用于产品标签等领域。那么,条码标签规格有哪些?这里物联...
  • 打印文件并配置打印机设置

    千次阅读 2020-12-20 10:51:45
    我试图在Windows上使用Python编写打印机自动化程序,但无法完成。我不是真的理解这个话题,我有点惊讶-一个...PDF已经存在,我不想创建PDF或任何其他文件类型。我喜欢打印这个PDF文件。一次一个文件。文件可以是横向...
  • 展开全部1.打开电脑AutoCAD2007版的来软件。自2.打开CAD后,输入限制,按空格键确2113认命5261令。3.在您确认了4102限制之后,在左下角1653有一个提示。...7.确定A后,设定A2的图纸尺寸。注意事...
  • 回答:public void Print(string FileName){StringBuilder logMessage = new StringBuilder();logMessage.AppendLine(string.Format(CultureInfo.InvariantCulture, "-------------------[ START - {0} - {1} ------...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 24,410
精华内容 9,764
关键字:

怎样设置打印纸类型