XSL Formatter V2 Q&A| Q. | How can I successfully output PDF by using ASP, in XSL Formatter? [No.2002030103] |
|---|---|
| A. |
We provide sample files. Click here to show an ASP script file and an HTM file. |
| Q. | I tried to save PDF generated by using ASP to a local hard disk. But I couldn't do it with an error message. Why? [No.2002041901] |
|---|---|
| A. |
Generally, when a client PC requests to a server PC, the server PC treats this client as guest account (IUSER account). Guest account cannot write PDF to the local hard disk because the disk is write-disabled. Please give write permission to guest account. |
| Q. | When PDF is generated display by using ASP, is it possible to display directly to the client browser, not to the local hard disk? [No.2002070501] |
|---|---|
| A. |
Yes. It's possible to display the created PDF data directly to the client browser by using our PDF Output option. Specify as follows:
|
| Q. | I would like to pass DOM object to XSL Formatter and also would like to output PDF stream to the browser by ASP directly. Can I do this? [No.2002093010] |
|---|---|
| A. |
From XSL Formatter V2.3, it's possible to pass DOM object to XSL Formatter. (You will not need to purchase SDK.) Also it's possible to output PDF stream to the browser directly only when using IIS server and ASP. |
| Q. | Is it possible to stream the output of your XSL Formatter across servers? I write a COM + component that calls your AXFOSVR.XFOObj on server and place that component on server. [No.2002100402] |
|---|---|
| A. |
Yes. We support to stream the output directly to a browser only when you use AXFOSVR.XFOObj via ASP. In other cases, AXFOSVR.XFOObj is not supported to be output to a browser directly. It's necessary to save it as a PDF file once and send it to a browser if you don't use it via ASP. |
| Q. | Is it possible to install XSL Formatter on a server system and use COM Interface of XSL Formatter from a client system? [No.2002102501] |
|---|---|
| A. |
We don't support to use XSL Formatter installed on a server system from a client system side (GUI, COM Interface). If you want to run XSL Formatter on a server system, you have to make an application that calls XSL Formatter and use this application from a client system side. |
| Q. | When I use XSL Formatter form ASP, I set the page number to be output to PDF by specifying 'StartPage' and 'EndPage'. However, all pages are output to PDF. Is it a bug? [No.2003011703] |
|---|---|
| A. |
Following is written in ASP. XMLFO.Source = Input_XMLFilename XMLFO.Stylesheet = Input_XSLFilename XMLFO.OutputFile = Output_Filename XMLFO.PrinterName = "@PDF" XMLFO.Startpage = 1 XMLFO.Endpage = 3 XMLFO.Clear() XMLFO.Execute() (Extract only the part that XSL Formatter calls) The problem is the Clear() method right before calling the Execute() method. If XSL Formatter call the Clear() method here, the page number specified to Startpage and Endpage are initialized and as the result , all pages are output.
It's better to call the Clear() method first, after you execute XSL Formatter. |
| Q. | I am evaluating your PDF Output Option in an ASP page to render PDF direct to the client. It works well and generates the PDF from XSL-FO, but the client browser does not interpret as PDF. [No.2003030701] |
|---|---|
| A. |
In your ASP, the following are written.
<%
dim objXML
set objXML = CreateObject("MSXML2.DOMDocument.3.0")
objXML.async = False
objXML.load "C:\inetpub\wwwroot\fo\test.fo"
dim objAXF
Set objAXF = Server.CreateObject("AXFOSVR.XFOObj")
objAXF.Clear()
objAXF.foXMLDOM = objXML
objAXF.PrinterName= "@PDF"
objAXF.OutputFile = ""
objAXF.ExtLevel=1
Response.ContentType = "application/pdf"
objAXF.Execute()
%>
<%'=objAXF.ErrorCode%>
<%
set objAXF=nothing
%>
The cause of the error exists in <%'=objAXF.ErrorCode'%> coming after objAXF.Execute(). I suppose it is written to let the error message shown on the client browser. However, if the formatting exits normally, '0'(zero) is set to objAXF.ErrorCode and it is shown on the client browser. Therefore the client browser does not interpret as PDF. If you want to display the error message only when an error occurred, please specify as follows:
<%
dim objXML
set objXML = CreateObject("MSXML2.DOMDocument.3.0")
objXML.async = False
objXML.load "C:\inetpub\wwwroot\fo\test.fo"
dim objAXF
Set objAXF = Server.CreateObject("AXFOSVR.XFOObj")
objAXF.Clear()
objAXF.foXMLDOM = objXML
objAXF.PrinterName= "@PDF"
objAXF.OutputFile = ""
objAXF.ExtLevel=1
Response.ContentType = "application/pdf"
objAXF.Execute()
Response.End
if objAXF.ErrorCode <> 0 then
Response.Write "Error: " & objAXF.ErrorCode & " " & objAXF.Reason
end if
Set objAXF = Nothing
Set objXML = Nothing
|
| Q. | Although I try to change the value of xsl:param using the SetParam method of AXFOSVR.XFOObj, it does not go well. [No.2003032802] |
|---|---|
| A. |
The "SetParam" method is effective only when using MSXML4 or MSXML3 as a XSLT processor. Please check whether the processor currently used is MSXML4 or MSXML3. |
| Q. | When I call XSL Formatter using IIS, the error message "IIS send an error : IID_IXFOCtl failed" appears. [No.2003060603] |
|---|---|
| A. |
Followings are written in ASP which calls XSL Formatter.
xlsfo.Source = Application("TMPFileDirectory") & xmlFileName
xlsfo.Stylesheet = Application("XSLFileDirectory") & xslFileName
xlsfo.PrinterName = "@PDF"
xlsfo.OutputFile = Application("WriteTemplateDirectory") & TempFileName
When an user runs ASP who has no write permission for the WriteTemplateDirectory, it's often the case that the error saying "IIS send an error : IID_IXFOCtl failed" is shown. In this case you'd better confirm if the user has the write permission for the 'WriteTemplateDirectory' folder. |
| Q. | Does XSL Formatter supports .NET API? [No.2002102502] |
|---|---|
| A. |
Yes. From XLS Formatter V2.5 MR3 and XSL Formatter V3 provides you with the .NET Interface. |
| Q. | I can see that your DLL is both: a non-visual formatting-and-printing engine and a visual canvas for the document. Are both uses supported and documented? [No.2002011505] |
|---|---|
| A. |
User interface program XSLFormatter.exe is using AXFO.dll as ActiveX control. You can integrate XSL Formatter engine to your own application. There are three integration choices.
We mainly offer ActiveX control interface document to OEM users. COM server and command-line are documented XSL Formatter's help file. |
| Q. | I would like to know how to create a pdf document from my fo-files using the com component (AXFO.dll). [No.2002011537] |
|---|---|
| A. |
You can output PDF files by specifying "@PDF" as PrinterName property. Click hereto download a sample file. |
| Q. | Could you provide any sample sources using XSL Formatter COM Interface? I would like to know how to handle errors occurred in XSL Formatter COM Interface. [No.2002011543] |
|---|---|
| A. |
XSL Formatter COM Interface returns the value of Execute method and exception error. You can download sample files from the following: |
| Q. | Is it possible to pass in a DOM Document of xml string instead of XML file, when we set Source property? [No.2002093006] |
|---|---|
| A. |
From V2.3, we prepare the property for passing DOM to COM Interface. See XSL Formatter Online Manual for more details. Click here to download a VBS sample file. |
| Q. | I am using the AXFOSVR COM object to format FO instances through a COM call. I've noticed that if the FO document I'm formatting refers to graphics that are not available (i.e., wrong filename in the src= attribute), AXFO returns a success return code (RC zero) but doesn't do the formatting. If there is a more serious problem, then I get a failure return code and a message. I suspect that these are warnings, so success is returned, but no output is created. Unfortunately, the environment I'm calling the Execute() method from (Epic editor) doesn't give me a way to intercept COM events so I have no way to trap the warnings. [No.2002100403] |
|---|---|
| A. |
If possible with Epic editor, please check the 'ErrorCode' property too. If the problem is not so serious, the error returns by the 'ErrorCode' property. |
| Q. | When passing DOM Object as FO to COM Interface 'AXFO.XFOCtl', the error message 'Graphic file not found' appears. Why? [No.2002101505] |
|---|---|
| A. |
The following shows a part of source code (VBscript):
dim domXML
set domXML = CreateObject("MSXML2.DOMDocument.3.0")
domXML.async = False
domXML.load "data/document.xml"
dim domXSL
set domXSL = CreateObject("MSXML2.DOMDocument.3.0")
domXSL.async = False
domXSL.load "data/sheet.xsl"
dim domFO
set domFO = CreateObject("MSXML2.DOMDocument.3.0")
domFO.async = False
' XML + XSL => FO
domXML.transformNodeToObject domXSL, domFO
dim xfoctl
dim xfoerr
set xfoctl = CreateObject("AXFO.XFOCtl")
' MSXML -> XSL Formatter
xfoctl.xfodoc.foXMLDOM = domFO
.
.
.
The graphic file is also stored in the Data folder. When creating FO from XSL and XML in which only the graphic file name specified using MSXSL, and passing DOM Object to XSL Formatter, the error occurs because the path information doesn't come form MSXSL. Therefore, please pass DOM Object of XML file and XSL file to XSL Formatter as follows. Then, the path information is given and the error doesn't occur.
dim domXML
dim domXSL
on error resume next
set domXML = CreateObject("Msxml2.FreeThreadedDOMDocument.4.0")
if Err = 0 then
on error goto 0
set domXSL = CreateObject("Msxml2.FreeThreadedDOMDocument.4.0")
else
on error goto 0
set domXML = CreateObject("Msxml2.FreeThreadedDOMDocument.3.0")
set domXSL = CreateObject("Msxml2.FreeThreadedDOMDocument.3.0")
end if
domXML.async = False
domXML.load "data/document2.xml"
domXSL.async = False
domXSL.load "data/sheet.xsl"
dim xfoctl
set xfoctl = CreateObject("AXFO.XFOCtl")
' MSXML -> XSL Formatter (XML + XSL)
xfoctl.xfodoc.sourceXMLDOM = domXML
xfoctl.xfodoc.stylesheetXMLDOM = domXSL
.
.
.
Pease note the following two points. First, please use "Msxml2.FreeThreadedDOMDocument.3.0" as MSXSL Object. If you use "Msxml2.DOMDocument.3.0" an error may occur. Second, if the version of MSXSL used inside XSL Formatter and the version of MXSXL which externally passes DOM of XSLT stylesheet are not the same, an error may occur. Therefore if MSXML 4 is installed on your system, "Msxml2.FreeThreadedDOMDocument.4.0" is required to use. (both are available using the above fixed code) |
| Q. | I don't know what printer name I should pass to PrinterName method when I run XSL Formatter using COM interface. [No.2003012403] |
|---|---|
| A. |
Basically the name indicated in the Windows printer dialog is used for the printer name. However, if you run XSL Formatter on a server and output to printer, specify the name that is indicated in the serial port list item. Please take the following steps: Add your target printer in "Add Printer" so that you can use Network printer on a server. (The icon of the printer will be added.) Right click the printer icon to display the printer properties dialog box. On the printer properties dialog box, click the Ports tag to display the port name (URI ) of the network printer with check mark. Please specify the port name to app.PrinterName. See also 2. Properties, or 6. How to specify printer name, in the Integration Interface Overview page on XSL Formatter online manual. |
| Q. | When I specify URL including a white space using COM Interface, an error showing the message "The system cannot locate the object specified". Occurs. Why? [No.2003013102] |
|---|---|
| A. |
URL you specify is as follows: objAXF.Source = "http://localhost/XSLFO/AntennaHouse%20Sample/document.xml" Normally, it is supposed to be: "http://localhost/XSLFO/AntennaHouse Sample/document.xml" It is considered that you replaced the space between AntennaHouse and Sample is with '%20'. When you pass URL including a white space using XSL Formatter COM Interface, please keep a white space as is. XSL Formatter will replace a white space with %20. |
| Q. | When I run formatter using COM Interface, an error occurs showing the message "Error code: -2146697209(0x800C0007)". What's wrong? [No.2003013103] |
|---|---|
| A. |
This is a bug of XSL Formatter before V2.3. It is removed with V2.4. |
| Q. | When I output a formatted result to PDF using COM Interface or Java Interface, and specify output pass name as URL type, an error occurs. Why? [No.2003020705] |
|---|---|
| A. |
When running this Java, path name of URL is given to OutputFile() method. However, it's not supported to specify URL path as an output destination with XSL Formatter. Then an error occurred and a file cannot be created. Please specify non-URL path name to OutputFile() method. e.g. An error will occur with the following path name. objAXF.OutputFile= "file:H:/ASPTest/TEST/Result.pdf" Please specify as follows: objAXF.OutputFile= "H:/ASPTest/TEST/Result.pdf" In addition, it's supported to specify "file:" type path as an output destination with XSL Formatter V3. |
| Q. | Looking at the interface of your COM-object AXFOPDF, it seems possible only to render PDF to disk. Is this true? If not, how do I render PDF to memory? What kind of "COM calls" to the API do I make? [No.2003030704] |
|---|---|
| A. |
Yes, it's true. XSL Formatter once create a temporary PDF file and display it to the client browser. It's a specification of XSL Formatter. It's impossible to display PDF stream to the client browser without having temporary PDF file for the present. |
| Q. | I wants to call XSL Formatter using Delphi. Although it imports 'AXFO 2.5 Type Library', the method or the property which are indicated by the online manual are not found. [No.2003072501] |
|---|---|
| A. |
A 'AXFO 2.5 Type Library' is the ActiveX interface. The ActiveX interface is disclosed only to those who has purchased the development kit (SDK) license. In case the other user calls XSL Formatter from Delphi, please import 'AXFOSVR 2.0 Type Library' using the type library import function, and use the COM interface. |
| Q. | Is it possible to call XSL Formatter from Java? [No.2002030104] |
|---|---|
| A. |
Yes. We prepare the interface program for Java from V2.2. It's possible by installing the module of Java Interface additionally. Refer to the Readme file and the document attached to Java Interface. |
| Q. | I need to be able to generate PDF document and send them back a browser. I have the FO document on the server. Is it possible to do so on a Java version server? [No.2002092005] |
|---|---|
| A. |
No. XSL Formatter provides the function that send PDF stream to a browser directly. It's possible only when using IIS server and ASP. |
| Q. | I see that System Requirements are Windows95/98/me/NT4.0/2000/XP. As AXFO.JAR is provided, can I operate it in the JAVA environment in the same manner? [No.2002102503] |
|---|---|
| A. |
As XSL Formatter V2 is designed to work only with Windows environment, it's not on with non-Windows OS environment. AXFOSVR.JAR acts as kind of a bridge for using Windows COM from JAVA in case of Windows+JRE(Java operating environment). That's the reason why it's not on with non-Windows OS environment. You can call XSL Formatter by using JAVA Interface in each environment. |
| Q. | When I try to use XSL Formatter using Java interface, the error message 'NoClassDefFoundError' appears. Why? [No.2003012404] |
|---|---|
| A. |
You may not specify the environment variable correctly. It's necessary to specify not only the folder name but also the file name 'AXFOSVR.jar' to CLASSPATH. First you check this point. e.g. set CLASSPATH= %CLASSPATH%;c:\Program files\Antenna\xslformatter\lib\axfosvr\AXFOSVR.jar; |
| Q. | Does XSL Formatter Java Interface correspond to multithread processing? [No.2003022102] |
|---|---|
| A. |
No. Java Interface does not correspond to multithread processing. If you want to run in multithread mode (apartment thread), please use COM Interface. |