Generate a catalog for print and web - pdf-generation

I need to create a solution, which allows a database driven catalog to be generated.
Assume, there are a bunch of products, images, prices, other details, and admin can generate catalogs based on "templates".
These templates essentially are "styles" of pages. For instance, style 1, could have 4x4 layout (16 products, with image and other attributes), hence on each page, upto 16 products and details could be displayed. Style 2 could have 2x2 layout, 4 products, but more detail. Admin can pick and choose different styles in a catalog.
Once the catalog is generated, it needs to be put up for either web viewing (lower fidelity) and/or print publishing (higher fidelity).
I would like help in determining the optimum stack to use, particularly, to "code" template and consequently to generate the PDFs.
Factors to consider
Minimum coding effort (reuse commercial or foss)
I will prefer an existing software which can create/edit "template" so I don't have to do that. I can simply get the license and reuse that functionality.
What I have considered so far is the following
Adobe XFA Forms as templates, connected to database to generate PDF.
I not sure which program can generate XFA templates. Acrobat X is an option however it does not seem to have control for adding images. The LiveCycle Server seems to be an overkill.
Use iText library, no idea if templates are possible or not, generate for web/print. Has good support for size/quality of catalog to print.
Use Open office, make template, and write the glue to retrieve data and generate an open office doc, which can easily be converted into html/pdf. No idea how tough/easy this is.
EDIT: Adobe Framemaker allows templates - I am evaluating if it can do the job that i have in mind. I will post an update once I am done.
I have no experience with any of these technologies, so if you can guide/rate them, or add other options that I did not consider.
At this point I am language agnostic. Alot of libraries provide hooks from various languages, so I don't think that will be a problem. If your solution is specific to foo language, please mention it as well.
Thanks for taking the time.
There is a followup question I asked on graphicsdesign exchange. https://graphicdesign.stackexchange.com/questions/2318/use-data-merge-of-indesign-using-console-or-through-an-api

How about Adobe inDesign Data Merge. And video here
Pretty easy to use aswel.

TCPDF (PHP) would give you quite a bit of control, and has lots of example code.
http://www.tcpdf.org/
I've used it before, it's not too hard to figure out.

I'm not sure if its a good fit, but maybe http://issuu.com/#whatIsIssuu

Related

Comic navigation in joomla?

I have a joomla site and would like to integrate some old unfinished webcomics to it, so I can pick them up where I stopped in a CMS that won't leave me in an absolute frothing rage (thanks, wordpress).
I've got some experience with Joomla and I believe it would be a pretty good platform for managing multiple comics... except for the small issue of horrid navigation between pages/articles. Joomla's integrated article navigation is a humble but passable start, but if you intend to use categories to organize chapters then getting from the end of one to the beginning of the next is... yeah. This is a pity, as Joomla's category and article management options are beautiful for archiving and presentation, and adding gantry 5 to it means a great deal of control over the reading experience. Basically, joomla has pretty much everything I want, except for the navigation.
Ideally, what I'd like to be able to accomplish for comic navigation in joomla is:
Clickable full-article-image leading to next article/page
Prev/next article buttons (already available)
Prev/next category buttons (do we have those?)
The latter two in a module I can choose where to publish (optional)
And this is it, basically. I understand that implementing the first could be very hard without some major template customization, in which case I'd be willing to insert the image as a link in the article body... but only if there was one single code I could use, like the one that generates the next category article button. Because I'm not willing to create hundreds of menu items to generate links page-by-page.
So is any of this doable?
This is a quick answer but too much for a comment. I'm assuming since you are on SO that you don't mind coding (as opposed to just configuring).
I think you need to do two things. First you need to create a pagination.php for your template. This will let you really super control what the pagination looks like. You can have images, special css and js, whatever you want. You can also add the "last" and "first" options.
I think you need to make a new plugin to replace the core pagenavigation plugin and that also generates the previous/next category links. (Or I guess you could make one just to do categorynavigation depending on what you want.) HOWEVER, it seems to me that there is data on the sibling links that is already being generated in the content category model so you might be able to use that. (Check the code; I think there was never a UI for it, but it is there. Even if it isn't there, siblings are very easy to obtain in nested sets)
The other thing you can really think about if you go that route is changing the whole thing somewhat to use a module that gets the current ID and category ID from JInput. You might also be able to use JPagination. The important thing, however is that you make sure to do the caching the way the pagination that is there does it. In other words you really want to cache the whole list in the order you want so you are not running so many queries and slowing your site down. You may want to look at the categories and category modules to get some ideas about the queries to do.
Hope that gets you started, but it is definitely something you can do without too much trouble.

How to deal with code duplication when natural templating (e.g. Thymeleaf)?

Thymeleaf puts a large emphasis on "natural templating", which means that all templates are already valid XHTML files. I always thought that is a great step forward that I can generate fragments in my templates e.g. in JSP I'd write
<tagfile:layout title="MyPageTitle">
<jsp:body>
Main content goes here
</jsp:body>
</tagfile:layout>
My "Layout"-Tagfile contains all the header-tags (title, link to stylesheets,...), the menu and justs inserts title text and body at the right point. I don't need to know anything about stylesheets menus or the like when designing my html fragement.
This is in contrast to the idea of Thymeleaf which encourages me to create full html pages (including a sample menu and all the headers). While the manual of Thymeleaf continues to emphasise how great this is, it never deals with duplication of code concerns:
I have one template that generates a menu and all my other templates (could be many) include a copy&pasted dummy menu just so that I can view the template in a browser without the server side generation mechanism. If I have 100 templates that means that prossibly the exact same dummy menu exists 100x (in each and every template). If I change the look of the menu it's not done with creating a new dummy menu, but I need to copy&paste the new dummy menu into 100 templates.
Even if I decide to do something as simple as renaming my CSS file I need to touch all my templates as well.
There is always the danger that my template looks just fine in my browser, but the generated output is broken because... well... I broke it (could be as simple as a misspelled variable name). Thus I will need to test the output with the actual generation anyway.
Did I misunderstand something there? Or is this indeed a trade-off? How do you minimize the impact of code duplication?
Natural Templates are just an option in Thymeleaf. As you can read here http://www.thymeleaf.org/layouts.html there are many options, including a hierarchical layout approach like the one you seem to prefer (I recommend you to have a look at the Layout Dialect).
However, Natural Templates are the preferred and most explained layout option because Thymeleaf was thought from the ground up to allow you to do static prototyping (in contrast to most other template engines). But it doesn't force you to.
So.. how are Natural Templates applied in the real world to avoid code duplication becoming an issue? That depends on the scenario, but one pattern we see repeated a lot is people creating full document, natural templates for 3-4 or maybe even a dozen of their application's templates, only those that are more likely to take a part in the design process --exchanged with designers, with customers...--, and simply not apply that header and footer duplication in the rest of the application's templates, making their creation and maintenance much simpler.
That way you can have the best of both worlds: a means to exchange fully displayable pages between programmers, designers and customers for the pages that this is really relevant; and also a reduced amount of duplicated code.
What's more, thanks to libraries like Thymol (referenced in the article linked above) you can even avoid code duplication completely, allowing your fragments to be dynamically inserted via JavaScript when you open your templates directly in your browser without running the application.
Hope this helps.
Disclaimer, per StackOverflow rules: I'm thymeleaf's author.

best way to handle complex page layout in joomla

I have to convert a static site for a client and it has to retain the exisiting layout.
Fortunately, most of the pages don't have to be editable, so for those I was going to use more or less the existing html.
The challenge I am having is that for many of the pages that do need to be editable, the content is laid out in columns (2, 3 and sometimes mixed)
This ( http://globalstrategies.org/index.php/give/hope-partners ) is an example of a page like that, and you can see others on the site where the layout is relatively complex.
I had thought of creating a jce stylesheet that would at least layout the page in the editor in a reasonable way (a bit like a responsive site, by having the columns stacked one after the other) , but I am concerned that my client may accidentally delete the surrounding classes/divs that create the more detailed structure.
I'm pretty familiar with Joomla and have built quite a few sites, but I've not used an cck tools and was hoping not to have to do that in this case, though maybe now is the time to learn.
Any advice / recommendations would be welcome !
Richard
Maybe ContentBuilder could do in your case, it's fairly easy and creates super-simple code, I've accomplished similar tasks with it. You provide the user with 3 fields (one per column) and create a layout for its display.
Another alternative is possibly even easier: you could override the use of the page functions in a template override of com_content/article, instruct the user to insert at most 2 page breaks, and use the page breaks to build the layout as you require.
If your sites is upgraded to the Joomla 3 you can use the build-in Bootsrap to do the layout.
You can find some more information how you can achieve this in the following page:
http://twitter.github.io/bootstrap/scaffolding.html#gridSystem

Algorithm / API for converting HTML to email friendly HTML (for newsletters)

I'm sure this is a very old question, but I could not find a straight answer
I'm looking for a works-mostly algorithm to take regular HTML content, and make it email client friendly.
I can rewrite any nice DIV layout to table layout, this is OK, but is there anything that will do it for me?
Here are my concerns
Overflow content - gmail etc ignores any overflow:hidden, the algorithm should address it
Clipped images - same as above, but here the solution will probably be server side clipping
CSS / Script / non standard tags - the algorithm should remove but keep the general look and feel
DIV layout to table layout, I heard it's a must, but I'm sure it's not an easy task to automate
There are many HTML to PDF converters, but I could not find a good HTML to "HTEMAIL" converter
Is there any standard or proposed standard for HTML for email clients? or is it an open jungle out there?
There is no way to make a converter that will be cross email client compatible. The closest you can get is using templates and adding text in certain sections using php or .net
I've been creating emails for 6 months, and the amount of time you spend correcting email client differences is normally around 50% of the time you spend making the email.
Here is some reading that may help you:
http://www.sitepoint.com/code-html-email-newsletters/
http://www.campaignmonitor.com/css/
As you can see from that last link there is no way to create an algorithm that can sort out all these issues.
Hope this helps
Another option that I've been using is to build the email in HTML or directly in Mailchimp. Once I'm happy with it, using Mailchimp, I click on preview and I get the email in a popup. The source code from the popup is email-client friendly (in tables). I then copy that code and use it for my emails.
Not ideal and a bit of trouble, but so far the best solution I can find.
And before people ask, I mostly us Mailchimp directly, but there is one situation that I have to kick it old school.

Joomla: display of articles using RAXO All-mode PRO and JXtended labels

I'm currently working on a site that uses the 'RAXO All-mode PRO' module to display a list of articles on the home page, and the 'JXtended labels' component to display pages containing a list of articles associated with given labels. The front-end functionality in both is very similar - get a list of articles and display them.
Ideally, I'd like both lists to display articles in the same format. However, since each component/module has its own way of fetching the data, and its own template, they're currently inconsistent. What's the best way of going about resolving this?
I can envisage a common bit of code (a module? plugin? component?) that deals with the display of a list of articles, and has its own template for that purpose. I guess I'd then need to hack the existing module and component to hand over to this common piece. There's also the question of getting the same set of data - e.g. RAXO All-mode PRO currently gets an article's category; JXtended labels doesn't.
Has anyone come across this issue before?
The issue of the modules pulling different data sets can only be remedied by hacking the core to get the data that is missing.
Everything else can be accomplished by a simple override. You can modify the module template files then save the new version in JOOMLA/templates/YOUR TEMPLATE/html/MODULE NAME/default.php. You can make the override files match pretty much exactly so the display will be consistent across both modules.

Resources