How to convert Office to PDF and set opening options by command line?

When you need to convert Office file to PDF and set opening options in Adobe Reader through command line, this article will be helpful for you. Opening options here I refer to are setting viewer preferences like Hide Tool Bar, Hide Menu Bar, Hide Window UI, Fit Window, Center Window, Display Doc Title, Non-Full Screen Page Mode and others. I use software VeryDOC DOC to Any Converter which allows you to convert DOC, DOCX, DOCM, RTF, TXT, PPT, PPTX, XLS, XLSX, OpenOffice ODT, HTML, MHTML files to PDF and set opening options. In the following part, I will show you how to use this software.

Step 1. Download DOC to Any Converter

  • If you need to know more about this software, please visit it homepage and you will find more surprising good functions of this software.
  • Once downloading finishes, there will be an zip file. Please extract it some folder then you can call the executable file in MS Dos Windows.

Step 2. Convert Office to PDF and set opening options.

  • Usage:   DOC2Any [options] <in-file> [<out-file>]
  • When you convert Office file to PDF and set opening options, you may need to use the following parameters.
    -pagelayout 6: TwoPageRight
    -viewpagemode <int>      : Set page mode that is used when opening the document in Adobe Reader
    -viewpagemode 0: No page mode is applied, default option
    -viewpagemode 1: Show outline tree
    -viewpagemode 2: Show thumbnails
    -viewpagemode 3: Open the document in full-screen mode
    -viewpagemode 4: UseOC
    -viewpagemode 5: UseAttachments
    -vieweropt <int>         : Set viewer preferences to Adobe Reader
    -vieweropt  1: HideToolBar
    -vieweropt  2: HideMenuBar
    -vieweropt  4: HideWindowUI
    -vieweropt  8: FitWindow
    -vieweropt 16: CenterWindow
    -vieweropt 32: DisplayDocTitle
    -vieweropt 64: Non-FullScreenPageMode, use -viewerval to set more options
  • Now let us check some examples of converting Office to PDF and set opening options.
    doc2any.exe -viewpagemode 1 -viewpage 10 -vieweropt  1"C:\in.doc" C:\out.pdf
    By this command line, we can convert word file to PDF and show outline tree, hide tool bar and show the 10th page.
    doc2any.exe -viewpagemode 5 -viewpage 4 -vieweropt  4 "C:\in.ppt" C:\out.pdf
    By this command line,we can set view 4th page when open it and hide Window UI.
    doc2any.exe -viewpagemode 1 -viewpage 10 -vieweropt  2 -view "C:\in.xls" C:\out.pdf
    By this command line, we can hide menu bar and set the 10th page at the started page.
    doc2any.exe -viewerzoom 1600 -vieweropt  8 -view "C:\in.docx" C:\out.pdf
    By this command line, when open 8th page as started page and set zoom rate at 1600.
    doc2any.exe -viewerzoom 1200 -viewpage 10 -vieweropt  1 6 -view "C:\in.doc" C:\out.pdf

Please check more examples in readme.txt. During the using, if you have any question, please contact us as soon as possible.

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

Verify Code   If you cannot see the CheckCode image,please refresh the page again!