Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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();
", 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 112
Default 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 thatll 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adobe inserting into Excel causing the adobe file to be low dpi Chronic Excel Discussion (Misc queries) 0 April 25th 07 10:16 AM
How do I send a spreadsheet to a printer outside the network? Moe in Goffstown Excel Discussion (Misc queries) 3 February 14th 07 04:34 PM
how to include fonts file in excel document to send outside? Atul from Solan INDIA Excel Discussion (Misc queries) 1 January 19th 07 08:21 PM
Why is my printer printing white fonts as black? Howie Excel Worksheet Functions 2 November 24th 05 09:33 PM
Send printer escape commands to a printer using VBA mikeburg[_41_] Excel Programming 3 October 6th 05 07:36 PM


All times are GMT +1. The time now is 10:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"