zoukankan      html  css  js  c++  java
  • place content in the center of pdf

    Sub ConvertPDFCenter()
    
        Dim workPath
        workPath = ThisWorkbook.Path
        With ActiveSheet.PageSetup
            .LeftMargin = Application.InchesToPoints(0.708661417322835)
            .RightMargin = Application.InchesToPoints(0.708661417322835)
            .TopMargin = Application.InchesToPoints(0.748031496062992)
            .BottomMargin = Application.InchesToPoints(0.748031496062992)
            .HeaderMargin = Application.InchesToPoints(0.31496062992126)
            .FooterMargin = Application.InchesToPoints(0.31496062992126)
            .PrintHeadings = False
            .PrintGridlines = False
            .PrintComments = xlPrintNoComments
            .PrintQuality = 600
            .CenterHorizontally = True
            .CenterVertically = False
            .Orientation = xlPortrait
            .Draft = False
            .PaperSize = xlPaperA4
            .FirstPageNumber = xlAutomatic
            .Order = xlDownThenOver
            .BlackAndWhite = False
            .Zoom = 100
            .PrintErrors = xlPrintErrorsDisplayed
            .OddAndEvenPagesHeaderFooter = False
            .DifferentFirstPageHeaderFooter = False
            .ScaleWithDocHeaderFooter = True
            .AlignMarginsHeaderFooter = True
        End With
        
        Range("A1:D16").ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
            workPath & "	.pdf", Quality:= _
            xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
            OpenAfterPublish:=True
    End Sub
    
    
        ActiveWindow.View = xlPageBreakPreview
        ActiveSheet.VPageBreaks(1).DragOff Direction:=xlToRight, RegionIndex:=1
    
  • 相关阅读:
    自解代理模式
    顺时针打印二维方阵
    Dom4j官网解释实例
    Eclipse快捷键大全
    MyEclipse快捷键大全
    SQL语句的增删改查(详细)
    MySQL用户权限详细汇总
    从表中随机返回n条记录
    证件照(1寸2寸)拍摄处理知识汇总
    java 实现文件内容的加密和解密
  • 原文地址:https://www.cnblogs.com/otfsenter/p/7490769.html
Copyright © 2011-2022 走看看