How do you specify fonts directory for swftools?
>From CMD line is appears to add a directory automatically:
"NOTICE Adding c:\swftools\fonts to font directories"
However when I run my .net web app, it errors because it cannot find the
fonts directory to import fonts.
And so does not generate the swf file.
============================================
.net Error ::
============================================
Title: 2003 NVRA Application Form
Creator: Adobe InDesign 2.0
Producer: Adobe PDF Library 5.0
CreationDate: 20031031140627Z
ModDate: 20060510164520-07'00'
Pages: 5
Linearized: yes
Encrypted: no
NOTICE processing PDF page 1 (576x792:0:0) (move:0:0)
WARNING The following font caused problems:
WARNING =========== Helvetica (ID:2097,0) ==========
WARNING | Tag: Helvetica-2097-0
WARNING | Type: 1
WARNING Font Helvetica (not embedded) could not be loaded.
WARNING Try specifying one or more font directories
NOTICE substituteFont(Helvetica-2097-0)
ERROR Couldn't find font Times-Roman- did you install the default
fonts?
============================================
Cmd line log ::
============================================
NOTICE Adding c:\swftools\fonts to font directories
Title: 2003 NVRA Application Form
Creator: Adobe InDesign 2.0
Producer: Adobe PDF Library 5.0
CreationDate: 20031031140627Z
ModDate: 20060510164520-07'00'
Pages: 5
Linearized: yes
Encrypted: no
NOTICE processing PDF page 1 (576x792:0:0) (move:0:0)
NOTICE processing PDF page 2 (576x792:0:0) (move:0:0)
NOTICE processing PDF page 3 (576x792:0:0) (move:0:0)
NOTICE processing PDF page 4 (576x792:0:0) (move:0:0)
NOTICE processing PDF page 5 (576x792:0:0) (move:0:0)
NOTICE SWF written
============================================
Example .net VB Code ::
============================================
Imports Microsoft.VisualBasic
Imports System.Data
Imports System.Data.SqlClient
Imports System.Configuration.ConfigurationManager
Imports System.io
Partial Class TestCreateSWF
Inherits System.Web.UI.Page
Protected Sub btnsubmit_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnsubmit.Click
RunProcess("C:\swftools\pdf2swf.exe", Chr(34) & txtin.Text &
Chr(34) & Chr(32) & "-o" & Chr(32) & Chr(34) & txtout.Text & Chr(34),
"")
If File.Exists(txtout.Text) Then
Response.Write("<br /><br /><br /><b>the swf file has been
created</b>")
Else
Response.Write("<br /><br /><br /><b>the swf file hasnt been
created</b>")
End If
End Sub
Sub RunProcess(ByVal process As String, ByVal params As String,
ByVal workingDir As String) 'As String
Dim p As Diagnostics.Process = New Diagnostics.Process
' this is the name of the process we want to execute
p.StartInfo.FileName = process
If Not (workingDir = "") Then
p.StartInfo.WorkingDirectory = workingDir
End If
p.StartInfo.Arguments = params
' need to set this to false to redirect output
p.StartInfo.UseShellExecute = False
p.StartInfo.RedirectStandardOutput = True
' start the process
p.Start()
' read all the output
' here we could just read line by line and display it
' in an output window
Dim output As String = p.StandardOutput.ReadToEnd
Response.write(output)
' wait for the process to terminate
p.WaitForExit()
' Return output
End Sub
End Class
_______________________________________________
Swftools-common mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/swftools-common