Consulting

Results 1 to 5 of 5

Thread: silent print to PDF

  1. #1

    silent print to PDF

    I am looking for help as I am not a programmer. I would like to be able to do the following:


    • to silently pdf the open Word document (no dialogues)
    • the output file name the same as the input file name
    • the output folder the same the input folder
    • automatically overwrite if the pdf file already exists
    • photographs in the text not downsized below 600 dpi


    There is a code (see below) that does all of the above but the last point . It uses "save as" function in MS Word which reduces the dpi of photographs to too low level. For the documents with photographs I need to manually use the "Microsoft print to PDF" which gives decent quality of pictures.

    A macro that prints using the "Microsoft print to PDF" meeting all of the criteria above points would be great. Could anybody help ?

    Sub Silent_save_to_PDF()
    '
    ' Silent Save_to_PDF Macro
    '
    ActiveDocument.ExportAsFixedFormat OutputFileName:= _
    Replace(ActiveDocument.FullName, ".docx", ".pdf") , _
    ExportFormat:=wdExportFormatPDF, OpenAfterExport:=False, OptimizeFor:= _
    wdExportOptimizeForPrint, Range:=wdExportAllDocument, Item:= _
    wdExportDocumentContent, IncludeDocProps:=False, KeepIRM:=True, _
    CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _
    BitmapMissingFonts:=True, UseISO19005_1:=False
    End Sub

  2. #2
    The following two images are from a document that contains a high resolution image. The first image was printed to pdf, the other saved using your macro. Both are at 800% zoom view in Adobe Acrobat. I doubt anyone would discern any difference at 100%.

    Print to PDF.jpg Save to PDF.jpg
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

  3. #3
    Thanks for the reply. Indeed, the difference is not big for graphics but it is significant for text. My photographs often contain text. Laboratory sample labels etc. I compare my outcomes below.

    top: Save as with macro, pdf file size 100kb, mag. 800x in Acrobat reader
    bottom: Microsoft print to pdf, pdf file size 160kb, magnification 800x in Adobe reader

    save as vs print.jpg
    Original MS Word document file size: 10 Mb

  4. #4
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

  5. #5
    Thanks a lot ! It works perfect.
    Exactly what I was looking for.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •