symbols export to PDF problem

  • Thread starter Sergey Poberezovskiy
  • Start date
S

Sergey Poberezovskiy

Hi,

My client requested a report with male and female symbols
next to a person's detail record. I have successfully
managed to use office symbols in Access report (Unicode
codes 2640 and 2642). Works fine on the Preview and Print
to a printer. The only problem nI have that when they try
to PDFWriter to create .pdf file those characters are
changing to question marks (which makes it difficult to
tell males from females).

Any ideas?
 
M

Mike Painter

Sergey said:
Hi,

My client requested a report with male and female symbols
next to a person's detail record. I have successfully
managed to use office symbols in Access report (Unicode
codes 2640 and 2642). Works fine on the Preview and Print
to a printer. The only problem nI have that when they try
to PDFWriter to create .pdf file those characters are
changing to question marks (which makes it difficult to
tell males from females).

Any ideas?

Tell them to look closer?

I just created one with both pdftypewriter and primopdf with no problem.
I used word and the alt-x method.
 
S

Sergey Poberezovskiy

Mike,

Unfortunately I am not familiar with neither pdftypewriter
nor primopdf. I need to print reports (programmatically)
and specify the file name in code. The only way I could
find at the time was to use Adobe PDFWriter driver and
then manually change the registry just before printing in:
Current_User\Software\Adobe\Acrobat PDFWriter
by setting
PDFFilename to the fileName and
bExecViewer to 0

if you know of a simpler way of specifying the fileName
destination of the report exporting to .pdf format, I
would appreciate a bit of code.

Thanks in advance.
 
M

Mike Painter

Sergey said:
Mike,

Unfortunately I am not familiar with neither pdftypewriter
nor primopdf. I need to print reports (programmatically)
and specify the file name in code. The only way I could
find at the time was to use Adobe PDFWriter driver and
then manually change the registry just before printing in:
Current_User\Software\Adobe\Acrobat PDFWriter
by setting
PDFFilename to the fileName and
bExecViewer to 0

if you know of a simpler way of specifying the fileName
destination of the report exporting to .pdf format, I
would appreciate a bit of code.
http://www.primopdf.com/ is a place to start. The free version does not
seem to be able to do what you want but the paid versions look like they
will.

Have you tried just changing the default output file in code after it has
been printed?
 
S

Sergey Poberezovskiy

The default option brings up the Save As... prompt - so
there is no default file :-(

And thanks for your replies - I will take a look at the
site you specified.
 
M

Michael Bednarek

Mike,

Unfortunately I am not familiar with neither pdftypewriter
nor primopdf. I need to print reports (programmatically)
and specify the file name in code. The only way I could
find at the time was to use Adobe PDFWriter driver and
then manually change the registry just before printing in:
Current_User\Software\Adobe\Acrobat PDFWriter
by setting
PDFFilename to the fileName and
bExecViewer to 0

if you know of a simpler way of specifying the fileName
destination of the report exporting to .pdf format, I
would appreciate a bit of code.

Here is some of the VBA code I use in a Word document to print it, using
the methods and properties of PdfDistiller. I have deleted substantial
parts of the code which was relevant to my task. I hope there's enough
left to show you how to print programmatically to a named PDF file.

As to your original question: you probably need to tell Distiller to
include certain fonts; probably in .joboptions .

Option Explicit
Sub Client_Reporting()

' Requires a Reference to "Acrobat Distiller" (ACRODIST.EXE)

Dim myDocument As String ' Active Document Name
Dim myFilename As String ' Report Filename
Dim theFolder As String ' The file's directory
Dim myPath As String ' Path to Report Files
Dim myPDF As New PdfDistiller ' Class PDFDistiller
Dim oldPrinter As String ' Save the old default
printer

oldPrinter = ActivePrinter ' Save the old default printer
' The next would change the System Default Printer; we don't want that.
'ActivePrinter = "Acrobat Distiller"

' Select a printer without changing the system default printer:
With Dialogs(wdDialogFilePrintSetup)
.Printer = "Acrobat Distiller"
.DoNotSetAsSysDefault = True
.Execute
End With

' This is the guts of it: PrintToFile a PS file with Distiller ...
Application.PrintOut OutputFileName:=myPath & myFilename & ".ps", _
PrintToFile:=True, Background:=False
' ... and convert it to PDF.
myPDF.FileToPDF myPath & myFilename & ".ps", "", theFolder & _
"\eBook-WebReports.joboptions"
Documents(myDocument).Close SaveChanges:=False

'ActivePrinter = oldPrinter ' Would restore previous default printer
' Select a printer without changing the system default printer:
With Dialogs(wdDialogFilePrintSetup)
.Printer = oldPrinter
.DoNotSetAsSysDefault = True
.Execute
End With

' Restore "PrintToFile" back to false by printing nothing!
' See: http://www.mvps.org/word/FAQs/MacrosVBA/ResetPrintToFile.htm
Application.PrintOut Range:=wdPrintRangeOfPages, Pages:="0", _
PrintToFile:=False

' Delete PS files
With Application.FileSearch
.NewSearch
.LookIn = theFolder
.SearchSubFolders = False
.FileName = "*.ps"
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles
.Execute
If .FoundFiles.Count > 0 Then
Kill theFolder & "*.ps"
End If
End With

Exit Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top