Create as many pages as necessary for dynamic content - adobe-indesign

I have a template which I'm filling with text. There is a header page, and several content pages after the header. Each content pages has two columns, and some logos and things at the bottom. I'm filling in the content dynamically with images and formatted text.
The number of pages is variable. How can I either duplicate content pages as needed, or (if I create a template with many pre-duplicated content pages) delete empty pages after filling in the content?

Well, you can add a page with myDoc.pages.add(...) and then duplicate the content.
To remove pages: myPage.remove().
But the question is somewhat vague, so it's hard to be more specific.

Related

Set minimal pages count in pdf using flying saucer

Is there any way to set minimal count of pages to pdf? So my current need looks like:
I have an header on second page that should be shown
First page has content that can overflow to second page
It is not acceptable to have 3 pages
So I need 2 pages in both cases:
First page fits to single page (so I should create second page manually)
First page overflows (at create second page by its content)
Single workaround that I found - overflow by empty (<br/>s) content. But I wanna do it with css.
I've tried to use #page:first but it wouldn't work in common css manner (like #page:first .break-page{...})
I've tried to use #page:first {break-page-after:always} - it wouldn't work...

Multiple headers, How to get different margin_top value for different pages

In my application, i need create a document pdf in wkhtmltopdf.
There are more than one pages in my document pdf. I generate dynamicly a file html static for header_html specified to the first page and another header_html specified for the rest of page.
My question is the two headers are not the same height:
How can i get margin_top value dynamicly for each page ?
Thank you for your answers.
If you want make your first page is different from the others pages. you can use cover page like:
wkhtmltopdf -H cover cover.html ...
doc

Sorted table of contents [TOC] in markup (md)

What is the best practice to list all H1 titles in markup language in sorted list?
If I use [TOC] - order is somehow random. Is there a better way to do it than manually write all links in file?
I am using creole as markup language on BitBucket.
The syntax there is
<<toc />>
which shows all the H1,H2 etc on the pages.
To sort the pages I am putting 1_,2_,3_,... in front of the page titles (not the H1 but the page title). In this way the page names are also numbered and organised.
You can also move files inside different directories and then create a table of content for each directory <>

SEO for Dynamically Loaded Images

I have a developed PHP code to dynamically load files contained in a directory into a gallery / slideshow. I have many (40 - 50) of these gallery web pages which display images grouped by content. With hundreds of images, the dynamic gallery code allows me to add images to a directory without having to write code to each web page each time.
However I've realized that these files will be invisible to search engines since there isn't any HTML code to index on (e.g. the 'alt' tag). Does anyone have any suggestions on how to get these images indexed? Two ideas I've had:
1) Write a program to automatically generate a single web page for every jpeg file which will display the image when found with the search engine and contain a link to the gallery page where the user can see more content. The benefit to this method is not having to modify my live web pages. The downside is hundreds of additional files only to be found by a search engine.
2) Write a program to generate hidden links that can be pasted into my gallery html page - using the alt tag. The benefit to this method is that users would find my main gallery page with a search. The downside is having to cut and paste code to my live gallery web pages - defeating somewhat the purpose of a dynamic gallery.
I'm new at this, so any suggestions would be appreciated.
If I understand you correctly:
I would have one page that just lists thumbnails of pages, and then one page for each of the images, that shows a bigger version of each image, and all the meta-data you have. The best would be if you added a short unique snippet of text to each image, describing what in it.

Progressive Rendering and SEO

The website I'm working on has a typical e-commerce product page, with the top part of the page containing the title, images and pricing, while the bottom part of the page has the tabs section, with tabs for Features, Specs, Accessories, Reviews and so on.
Naturally, this HTML Document is heavy. I think about splitting the page in two:
The HTML Document will contain only the top part of the page
Then JavaScript will call asynchronously another page, which contains a JSON object with the content of all the tabs; when successful - JavaScript will populate each tab with his content
The question is:
Will the Search Engines crawl the content that is loaded by JavaScript?
if not - then Progressive Rendering = Loss of SEO?
if yes - must I somehow ensure that all the tabs are populated prior to the Load event, or this doesn't matter?
I think that this question could be asked differently:
With SEO in mind, do the Search Engines crawl the HTML Document only, or they crawl the content of the page at time when the Load event takes place?
Any known best practices for this? any useful links?
Please advise.
Crawlers dont use js. Turn off JS in your browser to see what the crawler does. If you have links to these content pages it will crawl to them. If the SEO is important, make sure its in the page.
The search engines crawl the HTML document only as you describe it - don't use the JS solution you propose - diverse but appropriate content of your bottom tabs is important for SEO.

Resources