Specify what diagram to display in a generated document - documentation

I am in the process of creating a document template that has its own sections for each diagram in a package. In my template, I want to only show a specific diagram in a section and display another diagram in a different section elsewhere in the generated document.
1.0 Some text
1.1 Diagram1
1.2 Some more text
...
1.4 Diagram2
...
2.5 Diagram3
The issue that I've been running into is that when I insert the fragment into Diagram1 section to call the image with Custom SQL it'll stick every diagram from the package in there rather than the one I need.
I am not sure if I can even display a specific diagram from a Custom SQL but it was the option that made sense to try.

For complex and more customisation you can try document scripts with Doc generator class.
DocumentDiagram method in DocumentGenerator class will help you inserting diagrams inside the RTF documentation.
More details on DocumentGenerator class
Refer these blogs to know more about generating complex documentation
Generate complex documents from Enterprise Architect with a two-step
semi-automated approach
Generating Documents using Document Scripts in Enterprise Architect

Related

Print multiple pages using PDFBox

I have a list of text data containing links (PDActions) that might need to be rendered on more than one page. (see below)
**Table of Contents**
document1 link 5
document2 link 8
document3 link 11
Is there a simple way to just print all these content and let PDFBox decide to wrap the text and fit them in multiple pages as needed. And just give me the final PDDocument?
There are multiple answers on this topic such as this one. However, the answers are quite old, and I'm checking if there is a newer and simpler way to do it.
PDFBox version: 2.0.26
PDFBox essentially still only has that very low-level text drawing API but there are projects built on top of PDFBox offering automatic layout.
Allow me to quote the PDFBox FAQs
Can I use PDFBox to create complex layouts?
I'd like to use PDFBox to create a complex layout containing several paragraphs, tables, images etc. Is PDFBox fit for that purpose?
PDFBox being a low level PDF library provides the APIs to create page content such as text, images etc. But at this point in time it doesn't provide a higher level API to do page layout, paragraph handling, automatic line wrapping or create tables and such.
But PDFBox is the foundation of some projects which might help in that case. This includes projects such as
Boxable
BoxTable
easytable
pdfbox-layout
PdfLayoutManager
ph-pdf-layout
You may also want to consider using Apache FOP which allows to create complex documents from XML data and templates-

I need a (preferably free) PDF/Word generator .Net component that can work from a document template

I'm looking for a .Net component that will allow me to generate Word and/or PDF documents.
This must work on the server without MS Office installation. Preferably free. Also, it needs to be able to generate the documents based on an existing template of some sort i.e. I don't want to generate the whole document from scratch but allow a number of different templates that all have similar content that comes from elsewhere (e.g. database, XML files etc).
My initial investigations have turned up iTextSharp (but not sure if it can work from templates).
Any help that can expedite my investigation time will be much appreciated.
Thanks
I use ActivePDF at work with .NET - give it some HTML and it will output a pdf doc. However it isn't free - but we did look at a few other ways and this was 1
http://pdfcrowd.com/html-to-pdf-api/
It doesn't do word documents but converts html (your template) to pdf

Integrate JET Templates to an EMF-GMF plugin

I created an plugin that lets me model JSF Applications. I created it using Emfatic, Ecore, EMF, GMF.
So now i have 5 projects in my workspace:
myapp
myapp.diagram
myapp.edit
myapp.editor
myapp.tests
If i run myapp as a Eclipse Application i can draw/design a .myapp_diagram based on the meta-model.
Now I want to know how can i integrate JET Templates with what i have here.
I have the diagram, i know how to build JET Templates, i just want to know how can i feed the diagram as input to the JET temples so that code will be generated.
What i have done until now is convert the "myapp" project to JET Project and wrote the template files. But if i now run "myapp" and draw a diagram, theres nowhere a GENERATE CODE button/option.
Unfortunately none of the Eclipse-based modelling projects provide a "generate code" button. There are a wide range of possible model sources and code generation platforms (JET, OAW, Xpand), so you will have to implement the button and the relevant source code yourself. However, the process is fairly straightforward.
One approach is to implement an org.eclipse.ui.popupMenus extension point, which then calls the Java class necessary to generate the code.
As an example, you can check out the plugin.xml used in the IAML project to generate PHP/Javascript source code, using openArchitectureWare (OAW) templates. The relevant Eclipse Action is GenerateCodeAction - check out the method doExecute(). Hope this helps :)

Generating PDF documents from LISP

I want to generate a technical report from lisp (AllegroCL in my case) and I studied various packages/project to help me do this.
Requirements:
Need to generate a PDF
May create an intermediate format like RTF, Restructured TEXT, HTML, Word DOC or Latex
Need to be flexible to be able to add content throughout my application
Need to handle Multi-Page, Headers, Footers, Tables, inclusion of Images.
Possibilities:
cl-pdf and cl-typesetting: I checked this one out and it works for now, but is there a better alternative?
Some Latex generator, but ???
Question:
Do you know alternatives to easily generate (PDF) reports from lisp. What is the best workflow to go for?
we are using cl-pdf and cl-typesetting for the last 3 years and it has numerous issues... (like its confusion around encodings, or silently not rendering things that don't fit, or...) so, i don't recommend new development based on them.
currently we are in the process of moving all our export mechanisms to open document format. openoffice is all happy with it, and there's a plugin for ms office, too.
there's .fodt, the so called flat open document text format, which is a mere xml file describing a document. generating it is as easy as generating xml files.
you can also make parts of your document read-only with a password (insert a section and mark it read-only and protected by a password. when generating the xml, you can generate random hashes as password...).

Generate PDF from structured data

I want to be able to generate a highly graphical (with lots of text content as well) PDF file from data that I might have in a database or xml or any other structured form.
Currently our graphic designer creates these PDF files in Photoshop manually after getting the content as a MS Word Document. But usually, there are more than 20 revisions of the content; small changes here and there, spelling corrections, etc.
The 2 disadvantages are:
1) The graphic designer's time is unnecessarily occupied. The first version is the only one he/she should have to work on.
2) The PDF file becomes the document which now has the final revised content, and the initial content is out of sync with it. So if the initial content needs to be somewhere else (like on a website), we need to recreate it from the PDF file.
Generating the PDF file will help me solve both these problems. Perhaps some way in which the graphic designer creates a "Template" and then puts in tags/holders and maps these tags/holders to the relevant data.
Thanks :-)
There are some tools out there for doing this. XSL-FO is useful. Here is a tutorial for creating a pdf from xml (or xhtml) with cocoon. Also see Apache FOP.
You could format your SQL data as XML and still use the same templates this way.
I use the ReportLab python library for this. It could perhaps solve your problem, but you will need to do some work...
In the past I have written scripts that spit out LaTeX then used texi2pdf to solve this kind of problem.
Take a look at iReport and JasperReports at http://jasperforge.org.
iReport lets you design reports, and then you can either programatically fill it with the JasperReports library (Java), or just use iReport to manually create the report.
I have only used it for tabular data, but I don't think there would be any problem for other types of documents.
You could create a form and populate the entries programmatically using a pdf library like iText (Java).
You could look at doing the workflow in PostScript which is plain text that you can easily compose from fragments. Then you can use any free tool to convert to PDF.
Take a look at Prince XML. This tool allows to generate PDF based on XML or HTML and CSS.
A possible way is to use a template engine, like FreeMarker or StringTemplate: these are often used to generate HTML, but they are flexible enough to output any format, actually.
The problem is to make a PDF template, I suppose. Perhaps you can take a sample output and edit it to replace data with placeholders to be filled by the template engine. Might not be trivial!
Sounds like a job that SQL Server Reporting Services can handle quite easily.
Reporting Services allows you to query the data, define the layout, and export to PDF without any intervention. The PDF output can be distributed via email, stored on a file share, and accessed via a page on the report server.
It can handle XML data sources too.
Another approach to generating a PDF file from data is to use prawn, which is based on ruby. I was very pleasantly surprised by how much functionality is included in prawn. It may take some investment up front but this approach will give you a lot of flexibility.
You can combine CSStoXSLFO with XEP from RenderX for high quality output. With this solution you can merge XML data into an XHTML template, which is decorated with CSS. It can also generate charts with the fantastic JFreeChart library. CSS3 page media features are supported.