I am writing a vb program and need to convert a file to pdf. I have not had luck trying to use the distiller/print drivers etc. As of now I am using a command line:

intTestVar = Shell("C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe " & strFileName)

This opens acrobat and converts the file to a pdf....now I just need it to save automatically without prompting...is there a command line switch that would allow me to save with the default name?

if anyone has links to acrobat command line pages would be great.

-B

Dani AI

Generated

Brief, practical summary tied to the thread: launching Acrobat’s viewer from VB (the approach in ’s first post) is interactive and not intended for unattended “open-and-save” conversions. was right to point at Distiller, but Distiller is a PostScript→PDF engine — non-PostScript files must be printed to a PostScript stream or handled by the Office PDF add-in (PDFMaker). For generic printing, the Adobe PDF virtual printer will accept any printable file and hand it to Distiller; Distiller also supports command-line and automation interfaces for unattended jobs. (opensource.adobe.com)

Common, actionable choices (what to use and why):

  • Microsoft Office sources: use PDFMaker (Acrobat’s Office add-in) to preserve bookmarks, links and other Office-specific features. ()
  • Any printable file: print to the “Adobe PDF” printer and set the printer’s Adobe PDF Output Folder (or turn off “Ask for PDF file destination”) so no Save As dialog appears. ()
  • If Distiller must be driven directly, produce a PostScript file (print-to-file with a PS driver) and hand that PS to Distiller (command-line/automation) for a true PS→PDF conversion. (opensource.adobe.com)

Programmatic (VB) options and a minimal example:

  • Use Distiller’s COM automation (PdfDistiller) to convert a PostScript file without UI. This avoids user prompts when used correctly. Example (minimal):
Dim d As Object
Set d = CreateObject("PdfDistiller.PdfDistiller")
d.FileToPdf "C:\path\input.ps", "C:\path\output.pdf", ""

See the Distiller automation docs for the full object model and options. (opensource.adobe.com)

Registry trick and deployment notes:

  • For single automated print jobs, Distiller supports a PrinterJobControl registry key that supplies an output filename for a specific printing process (the key is removed after use). On 64‑bit systems the actual process might be splwow64.exe, so the registry entry must match the process that spawns the print job. The output folder must exist and the destination file must not already exist. Example registry entry format:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Adobe\Acrobat Distiller\PrinterJobControl]
"C:\Path\To\App.exe"="C:\Output\AutoSaved.pdf"

Use the Customization Wizard or registry settings for enterprise deployments and test the exact process name on the target machine. (opensource.adobe.com)

Notes and cautions: Distiller only accepts PostScript input; printing via Adobe PDF bypasses that by producing PS on the fly. PDFMaker generally gives the best Office results. The registry/auto-save tricks require correct process names, folder permissions, and that the destination file does not already exist — otherwise Distiller will prompt or fail. ()

I would use Distiller, so make sure that Distiller is installed.

What you will need is the proper switches as well as the input and output filenames as such.

acrodist [switches][inputFiles]

intTestVar = Shell("acrodist /O " & strOutPutFileName & " " & strInputFileName)

where /O = outputFileOrFolderPath

Here is a URL describing the proper parameters.

http://www.adobe.com/support/techdocs/11666.htm

Hope this helps.


Ray

I am writing a vb program and need to convert a file to pdf. I have not had luck trying to use the distiller/print drivers etc. As of now I am using a command line:

intTestVar = Shell("C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe " & strFileName)

This opens acrobat and converts the file to a pdf....now I just need it to save automatically without prompting...is there a command line switch that would allow me to save with the default name?

if anyone has links to acrobat command line pages would be great.

-B

Hi,

I have the same problem but distiller only accept ps file in input!!!


How can i give him other file (like doc, xls, jpeg,...)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.