How to Linearize PDF by Command Line?

   When creating PDF, we seldom pay attention to PDF optimizing. However, when we need to upload PDF to website or send PDF file to other in the situation where is in low speed net connections then we begin to consider how to compress them for fast web viewing. So why not optimize PDF in advance. In this article, I will show you one way of optimizing PDF.

Step 1. Download PDF Linearization Optimizer

  • VeryPDF PDF Linearization Optimizer  is developed for optimizing PDF for web view. This software is command line version, for those who need to develop website from PHP, command line version will be good.
  • For fast uploading and downloading, we have compressed it to zip file. So after downloading, please extract it to some folder. Then you can find the executable file and manual.

Step 2. Optimize PDF in compliance with usage.

Usage:pdfopt [options] <pdf-file> [<out-pdf>]

Parameter List
-mode <int>   : select different modes to Linearize PDF file
      -mode 0: Linearize PDF file automatically
      -mode 1: mode 1 to Linearize PDF file
      -mode 2: mode 2 to Linearize PDF file
      -mode 3: mode 3 to Linearize PDF file
      -mode 4: mode 4 to Linearize PDF file
  -skip         : don't overwrite an output file if it already exists
  -$ <string>   : input registration key

Examples:

  • When you need to optimize one PDF file, please refer to the following command line.
    pdfopt.exe C:\in.pdf C:\out.pdf
  • When you need to do batch optimizing, you can either use wild character or bat file. Please refer to the following examples.
    pdfopt.exe C:\in\*.pdf C:\out\*.pdf
  • for %F in (D:\test\*.pdf) do "pdfopt.exe" "%F" "%~dpnF-out.pdf"
    for /r D:\test %F in (*.pdf) do "pdfopt.exe" "%F" "%~dpnF-out.pdf"

  • When optimizing PDF, if you do not want to overwrite the source PDF file, please refer to the following command line.
    pdfopt.exe –skip C:\in.pdf C:\out.pdf
    -skip         : don't overwrite an output file if it already exists

Note:A linearized PDF file is not equal to compressed PDF, they are totally different. Please do not be surprised that after PDF linearization, the size of PDF does not became smaller. As  linearized PDF file is to restructure PDF elements  in a way allowing the first page of the PDF file to be displayed in a user Web browser before the entire file is downloaded from the Web server. If you need to know more knowledge about linearization, please pay attention to our website.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

This entry was posted in PDF Linearization Optimizer and tagged . Bookmark the permalink.

One Response to How to Linearize PDF by Command Line?

  1. VeryPDF says:

    Hi,

    I have many pdf files and I want to automatically change their Fast Web View properties from No to Yes, to optimize pdf for web. Is it possible to do that using Batch PDF Editor Tool? If not, would you consider adding such a feature?

    Thank you.
    Customer
    ------------------------------
    "Batch PDF Editor Tool" hasn't this function, we suggest you may try the "VeryPDF PDF Security and Signature Command Line" software,

    http://www.verypdf.com/app/pdf-security-and-signature/try-and-buy.html
    http://www.verypdf.com/dl2.php/pdf-security-signature-cmd-sdk-com.zip

    after you download and unzip it to a folder, you can run following command line to linearize your PDF file,

    pdfsecure.exe -perm -1 -linearize readme.pdf _out_linearize.pdf

    You can also run following command line to batch linearize PDF files in D:\temp folder and put output PDF files to D:\out folder,

    for %F in (D:\temp\*.pdf) do pdfsecure.exe -perm -1 -linearize "%F" "D:\out\_new_%~nF.pdf"

    Please look at following web page for more information about DOS FOR Command option,

    http://www.verydoc.com/blog/how-to-do-batch-conversion-with-verypdf-command-line-software.html

    VeryPDF PDF Linearization Optimizer Command Line and Advanced PDF Tools Command Line have PDF Linearization function too,

    http://www.verypdf.com/wordpress/201112/enable-fast-web-view-to-optimize-pdf-files-17223.html#comment-25292
    http://www.verypdf.com/app/pdf-linearization-optimizer-cmd/index.html
    http://www.verypdf.com/wordpress/201107/enable-fast-web-view-with-advanced-pdf-tools-command-line-v3-0-1641.html
    http://www.verypdf.com/wordpress/201112/enable-pdf-fast-web-view-using-command-line-15038.html
    http://www.verypdf.com/wordpress/201303/how-to-linearize-pdf-by-command-line-35432.html

    VeryPDF

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

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!