@VeryDOC

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.

DOC to Any Converter

How to insert PPT to PDF first page and set password to protect output?

   When you need to insert PPT file to one existed PDF file and set password to protect it, please read the following article. This method also can be used to insert DOC, DOCX, DOCM, RTF, TXT, PPTX, XLS, XLSX and others to an existed PDF file. And when you need to encrypt PDF, this method allows you to encrypt PDF from two levels in two aspects. In the following part, I will show you how to insert PPT to PDF and set password.

Step 1. Download DOC to Any Converter Command Line

  • DOC to Any Converter is Window command line application, it can be used to convert office file format to PDF and then overwrite, insert, append or rename PDF file if destination PDF file exists.  If you need to know more about this software, please visit homepage of DOC to Any Converter.
  • When downloading finishes, there will be a zip file. Please extract it to some folder and then check elements in it.

Step 2. Insert PPT to PDF and set password

  • When you run the conversion, please refer to the usage and examples.
  • Usage:       DOC2Any [options] <in-file> [<out-file>]
  • When you need to insert PPT to an existed PDF and set password, please refer to the following command line template.
  • doc2any.exe -append 1 C:\in.ppt C:\out.pdf
    doc2any.exe -append 2 C:\in.ppt C:\out.pdf
    doc2any.exe -append 2 C:\*.ppt C:\out.pdf
    doc2any.exe -append 2 -width 612 -height 792 C:\*.ppt C:\out.pdf
    doc2any.exe -ownerpwd 123 -keylen 2 -encryption 3900 C:\in.doc C:\out.pdf
    for %F in (D:\test\*.ppt) do "doc2any.exe" "%F" "%~dpnF.pdf"
    for /r D:\test %F in (*.ppt) do "doc2any.exe" "%F" "%~dpnF.pdf"
    Now let us check related parameters:

    -append <int>            : Append document to an existing PDF file
    -append 0: Overwrite if PDF file exists
    -append 1: Insert before first page if PDF file exists
    -append 2: Append to last page if PDF file exists
    -append 3: Rename filename if PDF file exists

    -keylen <int>            : Key length (40 or 128 bit)
        -keylen 0:  40 bit RC4 encryption (Acrobat 3 or higher)
        -keylen 1: 128 bit RC4 encryption (Acrobat 5 or higher)
        -keylen 2: 128 bit RC4 encryption (Acrobat 6 or higher)
      -encryption <int>        : Restrictions
        -encryption    0: Encrypt the file only
        -encryption 3900: Deny anything
        -encryption    4: Deny printing
        -encryption    8: Deny modification of contents
        -encryption   16: Deny copying of contents
        -encryption   32: No commenting
        ===128 bit encryption only -> ignored if 40 bit encryption is used
        -encryption  256: Deny FillInFormFields
        -encryption  512: Deny ExtractObj
        -encryption 1024: Deny Assemble
        -encryption 2048: Disable high res. printing
        -encryption 4096: Do not encrypt metadata

By this method and under the help of this software, we can insert PPT to existed PDF by command line. During the using, if you have any question, please contact us as soon as possible.

     

DOC to Any Converter

Convert text to PDF and control open mode by command line

In this article, I will show you one method of converting text to PDF in batch by command line and control viewing mode when you open output in Adobe PDF Reader. Meanwhile, this method can be used to convert DOC, DOCX, DOCM, RTF, TXT, PPT, PPTX, XLS, XLSX, OpenOffice ODT, HTML, MHTML files to PDF and control viewing mode.

  The great part of this method is software VeryDOC DOC to Any Converter. If you use server version or developer version of DOC to Any Converter,there is also integrated COM object (or DLL Library, or Command Line) availbel, enabling developers to access the converter via any programming or scripting languages, such as Visual Basic, C/C++, Delphi, ASP, PHP, C#, .NET, etc. In the following part, I will show you how to use it.

Step 1. Download DOC to Any Converter Command Line

All the VeryDOC Licenses are perpetual, once you pay for it then you can use it forever if you do not change software environment or need to update it to the latest version.

  • Once downloading finishes, there will be a zip file. Please unzip it and then check the elements in it.

Step 2. Convert text to PDF and control viewing mode

  • It is necessary to read help document before running this software. And when you use it, please obey rules and examples.
  • Usage:    DOC2Any [options] <in-file> [<out-file>]
  • When you need to convert text to PDF, please refer to the following command line.
    doc2any.exe C:\in.txt C:\out.pdf
  • doc2any.exe C:\*.txt C:\*.pdf
    for %F in (D:\test\*.txt) do "doc2any.exe" "%F" "%~dpnF.pdf"

      • When you need to convert text to PDF and control view mode, please refer to the following command line.
        doc2any.exe -viewerzoom 1600 -viewpage 10 -viewpagemode 2 -view "C:\in.doc" C:\out.pdf
        Now let us check related parameters:
      • -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
          -viewerval <int>         : Additional values used by -vieweropt 64
            -vieweropt 64 -viewerval 1   : UseNone
            -vieweropt 64 -viewerval 2   : UseOutlines
            -vieweropt 64 -viewerval 4   : UseThumbs
            -vieweropt 64 -viewerval 1024: UseOC
          -viewerzoom <string>     : Set viewer zoom ratio to Adobe Reader
            -viewerzoom FitBH: Display pages to fit the width of its bounding box
            -viewerzoom FitH : Display pages to fit the width of page
            -viewerzoom Fit  : Display pages to fit window
            -viewerzoom FitV : Display pages to fit height of page
            -viewerzoom FitB : Display pages to fit its bounding box entirely
            -viewerzoom FitBV: Display pages to fit height of its bounding box
            -viewerzoom 25   : Display pages with magnification at 25%%
            -viewerzoom 50   : Display pages with magnification at 50%%
            -viewerzoom 1600 : Display pages with magnification at 1600%%
          -viewpage <string>       : set start page when opening it in Adobe Reader
          -view                    : View PDF file after creation

      Please check above parameters and usage carefully then add corresponding parameters according to your needs. By those parameters, you can convert text to PDF and control viewing mode. During the using, if you have any question, please contact  us as soon as possible.

      DOC to Any Converter

      Word to EPS Command Line Converter- convert doc to eps and add page number

         VeryDOC Word to EPS Converter can help you convert word(doc, docx), RTF, TXT, PPT, PPTX, XLS, XLSX, OpenOffice ODT, HTML, MHTML files to EPS and add add various watermarks on output files through command line operation. If you need to know more about this software, please visit it its homepage. And in the following part, I will show you how to convert word to eps and add page number.

      Step 1. Download Word to EPS Converter

      • This is Windows command line software, when downloading finishes, there will be an zip file in downloading folder. Please extract it to some folder then you can call the executable file in MS Dos Windows.
      • And all the VeryDOC software are free and clear to be downloaded, so you can rest assured to use them.

      Step 2. Convert word to eps and add page number

      • When you run the conversion, please refer to the usage and examples in readme.txt file.
      • Usage:    DOC2Any [options] <in-file> [<out-file>]
      • When converting word to eps and add page number, please refer to the following command line templates.
      • doc2any.exe -wtext "Watermark %PageNumberRoman% of %PageCountRoman%" "C:\in.doc" C:\out.eps
        doc2any.exe -wtext "Watermark %PageNumberRoman2% of %PageCountRoman2%" "C:\in.docx" C:\out.eps
        By those above command line, we can convert doc, docx file to eps and add two different kinds of Roman character page number.
        doc2any.exe -wtext "Watermark %PageNumber% of %PageCount%" -walign 3 -wtype 1 "C:\in.ppt" C:\out.eps
        doc2any.exe -wtext "Watermark %PageNumber% of %PageCount%" -walign 2 -wtype 2 "C:\in.excel" C:\out.eps
        By this above command line, we can convert PPT, Excel to eps and add page number in the format of page count. Meanwhile, we can control page number style, position and others.

      Now let us check related parameters:
      -wtext <string>   : Watermark text on printed document
          -wtext does support following dynamic values:
          %PageCount%, %PageNumber%, %PageCountRoman%, %PageCountRoman2%,
          %PageNumberRoman%, %PageNumberRoman2%, %Author%, %Keywords%,
          %Subject%, %Title%, %Filename%, %Date%, %Time%
        -wtype <int>             : type of watermark
          0 : normal watermark
          1 : watermark on header
          2 : watermark on footer
        -wf <string>         : font name of watermark
        -wh <int>              : font size of watermark
        -wb                         : specify bold font
        -wi                          : specify an italic font
        -wu                        : specify an underlined font
        -ws                          : specify a strikeout font
        -wa <int>               : angle of watermark
        -wbox <string> : a rectangle to output formatted text, it is only useful for "-walign" option, eg:
          -wbox "0,0,595,842"
          -wbox "0,0,612,792"
          -wbox "auto"
        -walign <int>  : set text align or position. 1 : left    2 : center      3 : right

      Now let us check the conversion effect from the following snapshot. During the using, if you have any question, please contact us as soon as possible.

      input word file
                                input word document

      output eps file from ppt
                           output EPS file

      DOC to Any Converter

      Convert PPT to PDF and add page number as watermark by command line

         For some reasons, sometimes we need to convert PPT to PDF and add page number. There are many ways to figure out the conversion in the market, but may seldom ones catering to your needs.  Here I will share one method of convert PPT or PPTX to PDF and add page number by command line, which also allows you to do the conversion together with ASP/PHP/C#/.NET/... etc. server side applications.

        I use software VeryDOC DOC to Any Converter, which can help you convert DOC, DOCX, DOCM, RTF, TXT, PPT, PPTX, XLS, XLSX, OpenOffice ODT, HTML, MHTML files to PDF and add page number as watermark. In the following part, I will take converting PPT to PDF and adding page number for example to show you how to use this software.

      Step 1. Download DOC to Any Converter

      • All the VeryDOC software are free downloading and trying, so you can rest assured to download it and use it free for hundreds of times.
      • When downloading finishes, there will be a zip file. Please extract it to some folder then we can call the executable file in MS Dos Windows.

      Step 2. Convert PPT to PDF and add page number

      • When you run the conversion, please refer to usage and examples.
      • Usage:         DOC2Any [options] <in-file> [<out-file>]
      • When converting PPT to PDF and add page number, please refer to the following command line templates.
      • doc2any.exe -wtext "Watermark %PageNumber% of %PageCount%" -wpagebegin 10 -wpageend 20 -wpageoffset 100 "C:\in.ppt" C:\out.pdf
        By this command line, we can convert PPT to PDF and add page number. Meanwhile, you can control the conversion page range. In the above command line, we set the start page at 10 and the end page is 20.
        doc2any.exe -wtext "Watermark %PageNumberRoman% of %PageCountRoman%" "C:\in.ppt" C:\out.pdf
        By this command line, you still can not convert PPT to PDF but the dynamic page number using fonts of Roman characters.
        doc2any.exe -wtext "Watermark %PageNumberRoman2% of %PageCountRoman2%" "C:\in.pptx" C:\out.pdf
        This command line shows converting PPTX to PDF and add another type of Roman characters as page number.
        Now let us check related parameters:
        -wtext <string>          : Watermark text on printed document
            -wtext does support following dynamic values:
            %PageCount%, %PageNumber%, %PageCountRoman%, %PageCountRoman2%,
            %PageNumberRoman%, %PageNumberRoman2%, %Author%, %Keywords%,
            %Subject%, %Title%, %Filename%, %Date%, %Time%
          -wtype <int>             : type of watermark
            0 : normal watermark
            1 : watermark on header
            2 : watermark on footer
        -wpagebegin <int>        : first page to add the watermark
        -wpageend <int>          : last page to add the watermark
        -wpageoffset <int>       : a value to be added to page number

        Now let us check the conversion effect from the following snapshots.

      input PPT
                                         Input PPT file.

      output PDF from PPT
                          Output PDF file.

      During the using, if you have any question, please contact us as soon as possible.