Coder Social home page Coder Social logo

cajuncoding / pdftemplating.xslfo Goto Github PK

View Code? Open in Web Editor NEW
27.0 4.0 5.0 26.77 MB

This is a C# .NET solution that tests and illustrates the capabilities of Xsl-FO for dynamically generating PDF documents. It provides a way to generate the XSL-FO source xml from Xslt or Razor Templating to address various development teams. And it provides basic WinForms Application that can be used to aid in developing the Xslt and Xsl-FO markup.

Home Page: https://github.com/cajuncoding/PdfTemplating.XslFO

License: Apache License 2.0

C# 97.85% CSS 0.01% JavaScript 0.24% XSLT 1.22% HTML 0.67% ASP.NET 0.01%
pdf-templating pdf-generation template-engine xslt xslt-template razor-views pdf-rendering pdf-reports apache-fop xsl-fo

pdftemplating.xslfo's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pdftemplating.xslfo's Issues

System.InvalidCastException from 'Fonet.Layout.BlockArea' to 'Fonet.Layout.AreaContainer'

I have tested the XslFO.ViewerApplication with the Apache FOP Examples https://xmlgraphics.apache.org/fop/examples.html and some of them throw a System.InvalidCastException

STR
1- Run XslFO.ViewerApplication
2- Load Xsl-FO Source file: fop-2.3\examples\fo\basic\images.fo

Expected result
The pdf file is generated

Actual result

[XslFORenderer] System.InvalidCastException: No se puede convertir un objeto de tipo 'Fonet.Layout.BlockArea' al tipo 'Fonet.Layout.AreaContainer'.
   en Fonet.Fo.Flow.BlockContainer.Layout(Area area)
   en Fonet.Fo.Flow.Block.Layout(Area area)
   en Fonet.Fo.Flow.Flow.Layout(Area area, Region region)
   en Fonet.Fo.Flow.Flow.Layout(Area area)
   en Fonet.Fo.Pagination.PageSequence.Format(AreaTree areaTree)
   en Fonet.StreamRenderer.Render(PageSequence pageSequence)
   en Fonet.Fo.FOTreeBuilder.EndElement()
   en Fonet.Fo.FOTreeBuilder.Parse(XmlReader reader)

Notes
Removing the fo:block-container element from the .fo file renders the pdf file as expected:

<fo:block-container width="40mm" background-color="lightgray">
   <fo:block><fo:external-graphic src="../graphics/asf-logo-nt.png" width="100%" content-width="scale-to-fit" content-height="100%" border="solid 0.1pt" background-color="yellow"/> 
   </fo:block>
</fo:block-container>

By the way, nice development!

cannot use because of dependencies for PdfTemplating.XslFO NuGet package

Please note that the NuGet package page says that there are no dependencies,

https://www.nuget.org/packages/PdfTemplating.XslFO.Xslt/

But when I test the demo app without having Adobe Acrobat Reader installed, I receive this error:

https://imgur.com/a/EBKfO4e

According to this page my company would then need to apply for a license from Adobe. This means I am unable to use the software:

https://acrobat.adobe.com/us/en/acrobat/pdf-reader/volume-distribution.html?readstep

So clearly there are dependencies. What do you suggest? TIA.

NullReferenceException when pageReference is null

Hi,
I've just started to use the library but I am getting a NullReferenceException which appears to be because the pageReference is null and then added to the PdfArray in PdfGoTo Write method.

I think this is because it is set to null in IDNode CreateInternalLinkGoTo.

When it is set to null in this way, is the code expecting the pageReference to be set some other way after the instantiation of the PdfGoTo object?

It sounds like I may have a link to a document element that cannot be found? Any ideas how I can diagnose this?

Thanks,

John

Is fo:table supported?

Hi,
I am migrating an existing report to c#. Inside our FO-File we are using fo:table and corresponding tags.
Unfortunatly I cannot see the table in the resulting pdf.

Are Tables just not supported?

(I am using the exact same files with java as well and the table is rendered.)

User32.dll dependency on linux

Running our project on linux we get the following error:

PdfTemplating.XslFO.XslFORenderException: Error occurred while rendering the XslFO into Pdf File output. --->
PdfTemplating.XslFO.XslFORenderException: System.DllNotFoundException: Unable to load shared library 'User32.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable:
libUser32.dll: cannot open shared object file: No such file or directory
   at Fonet.Pdf.Gdi.LibWrapper.GetDC(IntPtr hWnd)
   at Fonet.Pdf.Gdi.GdiDeviceContent..ctor()
   at Fonet.Render.Pdf.FontSetup.AddSystemFonts(FontType fontType)
   at Fonet.Render.Pdf.FontSetup..ctor(FontInfo fontInfo, FontType proxyFontType)
   at Fonet.Render.Pdf.PdfRenderer.SetupFontInfo(FontInfo fontInfo)
   at Fonet.StreamRenderer.StartRenderer()
   at Fonet.Fo.FOTreeBuilder.Parse(XmlReader reader)
   at PdfTemplating.XslFO.Fonet.CustomExtensions.XslFOFonetHelper.<>c__DisplayClass3_0.<Render>b__2(Object sender, FonetEventArgs eventArgs)
   at Fonet.FonetDriver.FireFonetError(String message)
   at Fonet.Fo.FOTreeBuilder.Parse(XmlReader reader)
   at Fonet.FonetDriver.Render(XmlReader inputReader, Stream outputStream)
   at PdfTemplating.XslFO.Fonet.CustomExtensions.XslFOFonetHelper.Render(XDocument xXslFODoc, Stream outputStream, XslFORenderOptions options)
   at PdfTemplating.XslFO.Fonet.CustomExtensions.XslFONetXDocumentCustomExtensions.RenderXslFOToPdf(XDocument xXslFODoc, XslFORenderOptions options)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.