|
|
Comments and Discussions
|
|
 |

|
Hi all, i had a problem, i try to put the nfop in my .net 4 project but i always get this error:
impossibile risolvere l'assembly "C:\Users\lpezzali\Desktop\Genius Fatture\generatePDF\bin\Debug\generatePDF.dll" a cui si fa riferimento perché dipende da "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", non incluso nel framework di destinazione corrente ".NETFramework,Version=v4.0,Profile=Client". Rimuovere i riferimenti agli assembly non presenti nel framework di destinazione o definire una nuova destinazione per il progetto.
I tried to put the conversion in a separate project that create a dll, target of the project is famework 2.0
Any idea?
Thanks in advance.
|
|
|
|

|
hi,
I would like to mention that one of disadvantages of FOP is that you have to learn XSL-FO and you spend quite a lot of time testing your XSL:FO file until you get the perfect output. However in the mean time that are some XSL:FO editors that can help you overcome these small problems
here you have some links:
http://www.java4less.com/fopdesigner/fodesigner.php
http://www.ecrion.com/
|
|
|
|

|
Good job done... thank you
|
|
|
|

|
Hello Users,
I have tried nFOP and it works nice for PDF generation. However, I wanted to use it to generate RTFs. Anyone knows how to do this. ApacheFOP uses JFOR for RTF conversion. Do I need to import this library too? If so, how do I do it?
I have tried:
driver.setRenderer(8);
Doesn't generate an RTF file. During runtime, the process hangs up.
Help would be greatly appreciated.
Thanks,
Uday
|
|
|
|

|
Hi,
I want to create PDF with security options, such as "Print" is not allowed, "Content Copying" is not allowed.
How I have to add these properties when creating the PDF using NFOP?
Regards,
Vinoth
|
|
|
|

|
I need to add a password to this pdf. ANy ideas??
Thanks!
WiseLearner
|
|
|
|

|
Hi,
I am not sure about in FOP, however, you can do this with FO.Net
Regards.
|
|
|
|

|
Hello, World!
This a very great project to use FOP in C#. Well, I am facing run time error. Appreciate little help.
The below code compiles and works perfect.I have installed j# redistributable 2.0 and also jre.
FileInputStream streamFO = new FileInputStream(foFile);
InputSource src = new InputSource(streamFO);
FileOutputStream streamOut = new FileOutputStream(pdfFile);
//Driver driver = new Driver(src, streamOut);
//driver.setRenderer(Driver.RENDER_PDF);
//driver.run();
streamOut.close();
However, when I uncomment the Driver part, the result is same. The PDF file is not being written. When I open the file it is empty(error: "There was an error opening this document. The file is damaged and could not be repaired.") and never been written.
I suspect I haven't installed some of the libraries.
I have added the reference to vjslib.dll and also Fop.net.dll(renamed it to Apache.net.dll).
When I do 'Go to Definition..' for Driver it is leads me to some class. I believe I have added the dll in the right way. But, the problem is during run-time, the PDF is not being written.
Thanks,
Appreciate all the help,
Uday.
|
|
|
|

|
However, after several trial and error I have realized the problem is occurring due the nFop integration in my project. My project is a Windows NT service. It generates thread each time an event is launched and the thread the generatePDF functionality. Compiles perfect! when i run the service and launch ONE event, I see the pdf appeared at the destination folder. When I tried to open it, it says it been used by other program. OK! so, now I stop the service and open the file. It says it is damaged!
When two events are launched simultaneously, it shoots we a exception error. Does ISO8859_1 mean something?
Please help. Below is the code I have been working. fsw_Created is the function launched when the event occurs. Am I messing up with the threads?
private void fsw_Created(object sender, System.IO.FileSystemEventArgs e)
{
Thread t = new Thread(new ParameterizedThreadStart(Sendfile));
t.Start(info);
}
public void Sendfile(object _info)
{
String[] info = (String[])_info;
GeneratePDF(@"C:\Report.fo", "C:\Report.pdf");
}
private static void GeneratePDF(string foFile, string pdfFile)
{
FileInputStream streamFO = new FileInputStream(foFile);
InputSource src = new InputSource(streamFO);
FileOutputStream streamOut = new FileOutputStream(pdfFile);
Driver driver = new Driver(src, streamOut);
driver.setRenderer(1);
driver.run();
streamOut.close();
}
Thanks,
Uday.
|
|
|
|
|

|
Could not load file or assembly 'vjslib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
|
|
|
|
|

|
I'm at a point where I'm using NFOP to take an XML file, parse it using an XSL file, and save a PDF. However, because the XML is well formed, the html within it looks like this:
<p>Some text here <strong>bolded text</strong>
So in the PDF, this gets converted to:
<p>Some text here <strong>bolded text</strong>
The people who need to look at the PDFs don't know html and won't want to see this extra code.
I've tried using Saxon to parse through this particular bit of code, but errors display. I've learned via Google that Saxon and NFOP require the inclusion of their respective libraries (ApacheFop.Net.dll and IKVM.GNU.Classpath) but these libraries have an overlap in the form of org.xml.sax.
Does anyone use any particular parser to convert encoded xml as specified above into the appropriate characters - just for one or two nodes?
|
|
|
|

|
I'm trying to include the following image reference:
<fo:block>
<fo:external-graphic src="url(catcode_logo.jpg)"
width="99px" height="109px"/>
</fo:block>
I've also tried:
<fo:block>
<fo:external-graphic src="file:catcode_logo.jpg"
width="99px" height="109px"/>
</fo:block>
The image is at the same level as the other files, but it's not being included in the PDF. Are external graphics not supported by NFOP?
|
|
|
|

|
your tag should look like
<fo:external-graphic src="url(C:\\catcode_logo.jpg)" width="99px" height="109px"/>
Include the entire path.
|
|
|
|

|
Does anybody know what type of license Fop has?
I have found one post on the Apache mailing list that gives me some doubts if I can use this library in commercial applications.
The questions are as follows:
Thequestion is if the person who did that port did it correctly without
violating the Apache license.
He produces a source and binary distribution. The binary only contains a
DLL. No license included. The source however contains a copy of the
source code from FOP, Xerces and Avalon Framework.
Now, the following can be said:
- The Apache Software license is not included in his distributions.
- He took a copy of the source before we applied the long license
headers in FOP.
- The notice "This product includes software developed..." is missing
AFAICS.
- The name "nfop" might not be in line with the FOP license???
- It's not obvious where he potentially changed Apache code.
|
|
|
|

|
Hi, is it possible to embed for example EAN-13 ttf font in the code.
Using the userconfig.xml file and ean-13.ttf and ean-13.xml file...
Can someone help me out here.
|
|
|
|

|
Hi,
This code is working fine in my local, but when i placed this code in my QA server it is giving this error.
Please help me in this regard.
================================================
Microsoft (R) Visual Basic Compiler version 8.0.50727.1433
for Microsoft (R) .NET Framework version 2.0.50727.1433
Copyright (c) Microsoft Corporation. All rights reserved.
C:\inetpub\wwwroot\CBIQuestionnaire\PDF\Default.aspx.vb(11) : warning BC40056: Namespace or type specified in the Imports 'org.apache.fop.apps' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
Imports org.apache.fop.apps
~~~~~~~~~~~~~~~~~~~
C:\inetpub\wwwroot\CBIQuestionnaire\PDF\Default.aspx.vb(13) : warning BC40056: Namespace or type specified in the Imports 'org.xml.sax' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
Imports org.xml.sax
~~~~~~~~~~~
C:\inetpub\wwwroot\Ire\PDF\Default.aspx.vb(17) : error BC30182: Type expected.
Dim obj_DA As New DataAccess
~~~~~~~~~~
C:\inetpub\wwwroot\Ire\PDF\Default.aspx.vb(399) : error BC30002: Type 'java.io.FileInputStream' is not defined.
Dim streamFO As New java.io.FileInputStream(FoFile)
~~~~~~~~~~~~~~~~~~~~~~~
C:\inetpub\wwwroot\Ire\PDF\Default.aspx.vb(400) : error BC30002: Type 'InputSource' is not defined.
Dim src As New InputSource(streamFO)
~~~~~~~~~~~
C:\inetpub\wwwroot\Ire\PDF\Default.aspx.vb(401) : error BC30002: Type 'java.io.FileOutputStream' is not defined.
Dim streamOut As New java.io.FileOutputStream(PDFFile)
~~~~~~~~~~~~~~~~~~~~~~~~
C:\inetpub\wwwroot\Ire\PDF\Default.aspx.vb(402) : error BC30002: Type 'Driver' is not defined.
Dim driver As New Driver(src, streamOut)
|
|
|
|

|
hello,
reference-orientation is not supported in the nfop, is there any way i can do to make it work?
thanks,
grace
|
|
|
|

|
Hi,
How can I make documents with non Latin1 (WinAnsi) (for example Latin2) character sets?
I made a little app to make font and userconfig xml files. What's next?
|
|
|
|

|
Hi,
In Visual Sudio 2005, I am not able to build the nFop assembly i.e 'ApacheFop.Net.dll'
The following build error occurs:-
Error 1 /target must be 'exe' or 'winexe' if /main is specified ApacheFop.Net
please let me know how one can successfully build the ApacheFop.Net assembly.
Regards,
Lokesh
|
|
|
|

|
Thanks for the article, it really helps FO-newbies like me starting... I have a question about hyphenation: how can I use it in NFOP? The binaries I download from sourceforge just include a couple of DLL's, and if I try to generate PDF from a block like:
<fo:block hyphenate="true" language="en">...long text...</fo:block>
I get multiple warnings from the processor like:
...
Using org.apache.xerces.parsers.SAXParser as SAX2 Parser
building formatting object tree
setting up fonts
[1]
Couldn't find hyphenation pattern en
Error building hyphenation tree for language en
...
|
|
|
|

|
Hello,
I added Appache.Net.dll in the project reference and added namespaces of org.xml.sax, org.apache.fop, org.apache.fop.apps, org.apache.fop.tools and java.io. When I build the project, it said that namespace 'java' could not be found. I don't what is wrong. If you know what happened, please let me know. Thank you a lot!
Jin
|
|
|
|

|
You need to install the J# .net framework.
|
|
|
|

|
Thank you for a very useful piece of code! One question; I am using this to generate PDF reports from large fo files (>50MB), however the process takes a very long time (>10 minutes). Do you know any tricks to speed up this process? For example it takes about 2 minutes to set up fonts before even beginning to render the first page...
Any assistance would be greatly appreciated!
Darren
|
|
|
|

|
XslCompiledTransform is not available in .NET 1.1. How to use this in 1.1 framework?
|
|
|
|

|
Try this:
Dim foFile As New FileStream(Server.MapPath("~/Reports/clientData.fo"), FileMode.Create)
Dim UTF8enc As New System.Text.UTF8Encoding
Dim foStreamOut As New StreamWriter(foFile, UTF8enc)
Transform.Load(xReader, xResolver, MyEvidence)
Transform.Transform(xDoc, xslList, foStreamOut, xResolver)
(of course, you'll need to new-up your own xResolver, xslList, and MyEvidence objects too, but I hope this gives you the basic idea)
Sid DeLuca
|
|
|
|

|
Kind of difficult to set the support for true type arabic fonts
if anyone has an idea, that would be great. I saw recommendations for using a configuration file, but don't know how, or if it is the same as with an app.config.
for images, it works, I just specify the full path for the image.
Best Regards
Dinia
-- modified at 5:05 Wednesday 15th February, 2006
|
|
|
|

|
For Arabic, until now, I will use images with transparent backgrounds, using photoshop cs2 me, in collaboration with our graphics designer.
Dinia
|
|
|
|

|
At first generate the font metrics file of your font. To do this write the following command at command prompt window: 1. Go to your Fop Directory (version:fop-0.20.5)
2. java -cp
"build\fop.jar;lib\avalon-framework-4.2.0.jar;lib\xml-api
s-1.3.02.jar;lib\xercesImpl-2.7.1.jar;lib\xalan-2.7.0.jar;lib\commons-loggin
g-1.0.4.jar;lib\commons-io-1.1.jar;lib\serializer-2.7.0.jar"
org.apache.fop.fonts.apps.TTFReader
C:\Windows\Fonts\iqraa.ttf
"C:\myFonts\iqraa.xml"
3. After creating the font metrics file , copy it into Fop-0.20.5/conf/ directory and register your font in userconfig.xml file at the font tag. ex-
<!--<!DOCTYPE configuration SYSTEM "config.dtd">-->
<!--
this file contains templates which allow an user easy
configuration of Fop. Actually normally you don't need this configuration
file, but if you need to change configuration, you should
always use this file and *not* config.xml.
Usage: java org.apache.fop.apps.Fop -c userconfig.xml -fo fo-file -pdf pdf-file
-->
<!--
baseDir: normally the base directory is the directory where the fo file is
located. if you want to specify your own, uncomment this entry.
This value can also be a URL. Actually, the value is converted to
a URL.
-->
<!--
baseDir
-->
<!--
fontBaseDir: Similar to baseDir, except that this value is used for fonts. If
it isn't specified, the value from baseDir is used.
-->
<!--
fontBaseDir
-->
<!--
************************************************************************
HYPHENATION
************************************************************************
-->
<!--
hyphenation directory
if you want to specify your own directory with hyphenation pattern
then uncomment the next entry and add the directory name
-->
<!--
hyphenation-dir
/java/xml-fop/hyph
-->
<!--
************************************************************************
Add fonts here
************************************************************************
-->
<!-- example -->
<!--
-->
<!-- Example Japanese fonts
-->
<!--
-->
4.copy your .xml , .xsl files in to Fop directory
5. Write the following command at command promt C:\Fop-0.20.5\Fop -cp conf/userconfig.xml -xml yourfile.xml -xsl yourfile.xsl -pdf yourfile.pdf
you get the output , I hope.
Alam
|
|
|
|

|
thanks, I'll try it, and let you know. I am working with C#.net
Dinia
|
|
|
|

|
Hi.
Did you get this problem solved, and if you did can you post it here. Cause I am having a similar problem. I managed to generate the characters with Apache FOP, but how can I do it with nFOP?
Thanks,
Mystique
|
|
|
|

|
Hello guys, sorry for not responding in so long. I have given up generating arabic characters, and used images instead. I create images with photoshop, and then use them in document.
Dinia
|
|
|
|

|
Are there any WYSIWYG-Editors or other Tools, that help to generate FO?
Don't want to mess around too much with the FO-Syntax...
|
|
|
|

|
As far as I know:
1. Altova XMLSPY as an editor (somewhat visual) and a debugger with preview;
2. Activestate Komodo as a textual editor with autocompletion but no preview.
Both tools are commercial
Cheers,
gsa
|
|
|
|

|
Thanks for your response! I will have a look at them.
Any other suggestions?
|
|
|
|

|
Try XSL Report Designer V2
http://www.antennahouse.com
|
|
|
|

|
Report viewer(http://www.gotreportviewer.com) is an easy solution ... and provide export in Excel and PDF for local
Andrei Ignat
|
|
|
|

|
I'm already using nFOP but some features are inactive (SVG support...) and there is some memory leaks.
Have you tried to use IKVM.NET to build your own portage?
It seems to be a good solution but so far it is hard to build (many dependencies).
|
|
|
|

|
Right, I have also noticed that all the properties defined in FO are not implemented in nFop. I noticed for example space padding for the table cells. But there are other ways to do it like the space margin on the Block elements
I haven't tried IKVM
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.
|
How to use generate PDF files on the fly using nFOP
| Type | Article |
| Licence | CPOL |
| First Posted | 11 Jan 2006 |
| Views | 121,126 |
| Downloads | 1,756 |
| Bookmarked | 46 times |
|
|