|
From: | John Sim |
Subject: | RE: [Swftools-common] .net VB Font issues with swftools? |
Date: | Thu, 11 Jan 2007 11:42:20 -0000 |
New
Problem.. Upgraded to Newest version of pdf2swf
tools released yesterday… I can now specify the font directory. But… Now I have a new problem running the app
from .net Swftools
-F "c:\swftools\fonts" "C:\swftools\exp.pdf" -o
"C:\swftools\exp.swf" This works fine and generates all pages from
CMD line. But when I put it into .net it does not
generate any pages and the output looks as if it only tries to generate page 1
of 5? If I use this command and specify
generate only 1 page like this: pdf2swf
-p "1" -F "c:\swftools\fonts"
"C:\swftools\exp.pdf" -o "C:\swftools\exp.swf" The file is generated fine in .net; is it
possible to specify all pages within the pdf without knowing the total? This command also works specifying range
from 1 to 5 in .net app. pdf2swf
-p "1-5" -F "c:\swftools\fonts"
"C:\swftools\exp.pdf" -o "C:\swftools\exp.swf" Thanks J From:
address@hidden
[mailto:address@hidden On Behalf Of John Sim 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 |
[Prev in Thread] | Current Thread | [Next in Thread] |