+ Reply to Thread
Results 1 to 4 of 4

howto send host fonts to adobe pdf printer

  1. #1
    Abraham Andres Luna
    Guest

    howto send host fonts to adobe pdf printer

    hello everyone,

    how do i sent the host fonts when i programmatically print to the adobe pdf
    printer.

    this is my code:

    Microsoft.Office.Interop.Excel.Application appExcel = new
    Microsoft.Office.Interop.Excel.Application();
    appExcel.Workbooks.Open(@"C:\RDK\test.xls", Type.Missing, Type.Missing,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing);
    Microsoft.Office.Interop.Excel.Worksheet wsFile =
    (Microsoft.Office.Interop.Excel.Worksheet)appExcel.Sheets[1];
    wsFile.PrintOut(1, 1, 1, false, "Adobe PDF", true, false,
    @"C:\RDK\test.pdf"); //this line fails

    i get a popup telling me to send the host fonts. the total error message is:

    "When you create a PostScript file you have to send the host fonts. Please
    go to the printer properties, 'Adobe PDF Settings' page and turn OFF the
    option 'Do not send fonts to Distiller'".

    thank you for your help.




  2. #2
    Abraham Andres Luna
    Guest

    Re: howto send host fonts to adobe pdf printer

    ok, so i changed the adobe pdf printer preferences under the adobe pdf
    settings tab to:
    View Adobe PDF results is not checked
    Prompt for Adobe PDF filename is not checked
    Add Document Information is not checked
    Do not send fonts to Adobe PDF is not checked
    Delete log files for successful jobs is checked
    Ask to Replace existing PDF file is not checked

    and now this code works:
    Microsoft.Office.Interop.Excel.Application appExcel = new
    Microsoft.Office.Interop.Excel.Application();
    appExcel.Workbooks.Open(@"C:\RDK\RDK Doc.xls", Type.Missing, Type.Missing,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing);
    Microsoft.Office.Interop.Excel.Worksheet wsFile =
    (Microsoft.Office.Interop.Excel.Worksheet)appExcel.Sheets[1];
    wsFile.PrintOut(1, 1, 1, false, "Adobe PDF", false, false, Type.Missing);
    appExcel.ThisWorkbook.Close(false, Type.Missing, Type.Missing);
    appExcel.Quit();

    so this will print the first worksheet of rdkdoc to a pdf without asking for
    a filename, etc.

    but lets say i have lots of worksheets in the excel file. watch what happens
    when i try to print all of them:

    Microsoft.Office.Interop.Excel.Application appExcel = new
    Microsoft.Office.Interop.Excel.Application();
    appExcel.Workbooks.Open(@"C:\RDK\RDK Doc.xls", Type.Missing, Type.Missing,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
    Type.Missing, Type.Missing);
    int i = 1;
    foreach (Microsoft.Office.Interop.Excel.Worksheet wsPage in appExcel.Sheets)
    {
    wsPage.PrintOut(1, 1, 1, false, "Adobe PDF", false, false, Type.Missing);
    Application.DoEvents();
    while (!File.Exists(@"C:\RDK\RDK Doc.pdf"))
    {
    Thread.Sleep(3000);
    }
    string strFile = @"C:\RDK\page" + i.ToString() + ".pdf";
    File.Delete(strFile);
    File.Move(@"C:\RDK\RDK Doc.pdf", strFile);
    i++;
    }
    appExcel.ThisWorkbook.Close(false, Type.Missing, Type.Missing);
    appExcel.Quit();

    the first worksheet will print fine, but after that, excel starts prompting
    me for a filename.
    can anyone help with this issue?



  3. #3
    Abraham Andres Luna
    Guest

    Re: howto send host fonts to adobe pdf printer

    the solution works but doesn't make sense.
    you have to close the excel file and application then reopen it to print
    another worksheet
    this will stop the adobe pdf driver from prompting for filename when
    printing more than one worksheet.



  4. #4
    Mats Samson
    Guest

    Re: howto send host fonts to adobe pdf printer

    Hello Abraham,
    did you make your setting from within Excel Print Properties? That might be
    the reason. The trick to get rid of the saving prompt was to change the
    printer properties in the Control Panel – Printers and Faxes – Adobe PDF –
    Properties – Printing defaults.
    You cannot set these properties permanently within the properties in Excel,
    as soon you have reset to your Standard Printer the options are selected
    again.
    Clear the selections for “Prompt for Adobe PDF filename” AND “Do not send
    fonts to “Adobe PDF””. Both are important, the latter for the driver to make
    the Postscript files that’ll be deleted after conversion to PDF-files.
    Good luck


    "Abraham Andres Luna" wrote:

    > the solution works but doesn't make sense.
    > you have to close the excel file and application then reopen it to print
    > another worksheet
    > this will stop the adobe pdf driver from prompting for filename when
    > printing more than one worksheet.
    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1