Quantcast
Channel: Adobe Community: Message List - InDesign Scripting
Viewing all 37788 articles
Browse latest View live

MySQL to InDesign

$
0
0

Hi,

 

I currently have the data for a book in a MySQL database. One table contains the book metadata (title, subtitle, ISBN, etc.) and another contains the chapters (title, text, etc.). The chapters (about 40 in all, each about 1,200 words) are tagged with HTML. I use a PHP script to write this content to either a web-based book (separate .html files) or an EPUB book (.xhtml files, .opf file, TOC, etc, which are then zipped into a .epub file). This works well (that is, the book looks good and the EPUB file validates).

 

My next step is to create screen and print-ready PDFs. I've tried using Access VBA to write the MySQL content to a Word doc and then export to PDF using Acrobat. The results are, not surprisingly, only mediocre, mostly because Word is such a poor page design tool.

 

InDesign is far superior, so my question is this: What is the best way to get my metadata and HTML content from MySQL into an InDesign book structure?

 

When I say "best", I mean "with the least amount of manual tweaking afterward, but still looking great."

 

I can code at a high level in PHP and JavaScript and I know my way around XML and InDesign. Note that this doesn't have to be two-way. That is, I'm fine having the MySQL data as the "master copy" of the book, so any changes would flow from MySQL to InDesign (but not the other way).

 

I've looked into third-party database plugins, but why pay hundreds, even thousands of dollars when I can code something myself?

 

Any and all suggestions are appreciated.

 

Cheers,

Paul


Re: MySQL to InDesign

$
0
0

Hi Paul,

 

I’m sure it’s possible to write such a script in Visual Basic. I did something similar a couple of years ago to get “live” data directly from an Excel spreadsheet into an InDesign document. Usually I do this via CSV-file because it’s easier. From my practical experience I can say that interacting of InDesign with other apps (VB for Windows/AS for Mac) works well.

 

Regards,
Kas

Re: Is it possible to set a log level for ID and/or IDS when opening an IDML?

$
0
0

Try to disable "Preflight". That helped me with scripts which created a lot of hyperlinks: 10,000+ per document.

Re: Current page (not Document) width and height with JSX

$
0
0
Main();

function Main() {
    var doc = app.activeDocument,    pages = doc.pages,    page, width, height;       for (var i = 0; i < pages.length; i++) {        page = pages[i];        width = page.bounds[3] - page.bounds[1];        height = page.bounds[2] - page.bounds[0];        $.writeln("Page: " + page.name + " - " + "width = " + width + ", height = " + height);    }
}

Re: Delete first empty row in a table

$
0
0

Hi Uwe,

 

Thank you for your valuable information.

 

 

Regards,

Velu

Re: MySQL to InDesign

Re: MySQL to InDesign

Re: MySQL to InDesign

$
0
0

Very interesting! I'll check it out, Uwe, thanks.


Re: Is it possible to set a log level for ID and/or IDS when opening an IDML?

$
0
0

Hey Kasyan.

 

First, thanks for the response.

 

It does seem like turning preflight off in the UI-based InDesign (Window – Output - Preflight) does get an IDML with almost 10,000 hyperlinks to open a bit faster. I don’t, however, see the same open file performance improvement for the UI-less InDesign Server (app.preflightOptions.preflightOff = true;) which is the real issue for us. That might not be surprising though as I think though that preflight might be off by default in InDesign Server. In the ExtendScript Toolkit the Data Browser even shows “preflightOff = true”.

 

I should have mentioned that, to also attempt to speed up open times, the following are unchecked in ID…

 

   [ ] Check Links Before Opening Document

   [ ] Find Missing Links Before Opening Document

 

…which should correspond to setting the following to false in a *.jsx script with IDS…

 

   app.linkingPreferences.checkLinksAtOpen = false;

   app.linkingPreferences.findMissingLinksAtOpen = false;

 

While it "only" takes about 2 minutes to open a 2MB, 182 page IDML file with all of those hyperlinks and no embedded images in ID, that same file takes about 40 minutes to open in IDS.

 

/Chris

Re: Is it possible to set a log level for ID and/or IDS when opening an IDML?

$
0
0

Are these hyperlinks in some way linking to another InDesign document?

Re: take variables from file to dizdir with indesign illustrator

$
0
0

Can youhelpa JavaScriptcodecancustomize themenuplace? Which oftheartboardin the fileI chosetoputinacodecandeterminehow many

Re: Is it possible to set a log level for ID and/or IDS when opening an IDML?

$
0
0

Nope. They just point to fictitious URLs. It's purely for bookmarking purposes.

 

I see all kinds of process activity for the active InDesignServer.exe (there are four such EXEs on this quad-core host) during the 40 minutes it takes to open the file in question so InDesign Server is doing something. The question though is what is it doing.

 

Since the console output for InDesign Server shows the log4-like INFO, WARN etc. messages, it would seem that DEBUG logging could maybe be configured to see what activity is going on.

Re: layer hierarchy?

$
0
0

Hi BSAphex,

 

Try replacing this part.

 

 

    tell active document

       set zero point to {0, 0}

       set myNewLayer to make new layer with properties {name:"TOP LAYER"}

       tell myNewLayer

            move to beginning of layers of active document

        end tell

       make new rectangle with properties {geometric bounds:{0, 0, 21, 21}, fill color:"None", stroke weight:0.5, stroke color:"Registration", stroke alignment:inside alignment}

 

end tell

 

greenrookie

Re: Current page (not Document) width and height with JSX

$
0
0

Many thanks Jarek.

I was not aware of page.bounds and that put me in the right track.

Re: Current page (not Document) width and height with JSX

$
0
0

Many thanks Kasyan,

That worked just perfectly!

 

Nice job!


Re: Is it possible to set a log level for ID and/or IDS when opening an IDML?

$
0
0

On a Mac you either use the Activity Monitor or the Instruments application (part of the Xcode IDE) for various performance analysis down to the system calls (dtrace) and their invocation stack frames. I assume Windows provides similar tools, or you might just reproduce your problem on a spare Mac with a trial or developer license.

Let me see - yup, the technology exists on Windows - Trace Provider

 

Btw, InDesign (Server and Desktop) has separate "debug" builds for plugin developers with plenty internal consistency checks "assert" and debug output. For speed reasons these are stripped out from release builds, it might be worth a try if you have access to those builds. Of course they will take even longer... The above mentioned analysis via the OS may also benefit from more symbols on such development versions.

 

InDesign Server (even release build) also has some performance metrics available via scripting (somewhere on the app object), have you tried these?

 

On the other hand it could also be something unrelated - do you have any extra software (plugin, startup scripts, scripted event handlers) that could interfere? E.g. a link event handler that waits for a timeout on every $.write without connected ESTK? On one client's InDesign server farm I reduced restart times down from minutes to barely noticable just by optimizations of the startup process, before I tracked down and eliminated the bugs (in the SOAP interface and in XPath) that caused all those crashes ;-) . Of course such problems are beyond the scope of a forum, they take several days to analyze and solve, especially if they require changes of the binaries from Adobe.

 

Dirk

Re: Is it possible to set a log level for ID and/or IDS when opening an IDML?

$
0
0

I would just add that if you're getting this issue also with the regular

version of InDesign, then it's not really a scripting question. For your

own advantage, you may want to consider re-asking this in the regular

InDesign forum -- you might get some more help there. I do recall

similar questions being asked.

Re: Is it possible to set a log level for ID and/or IDS when opening an IDML?

$
0
0

There is also a forum dedicated to InDesign Server, as this appears to be a server specific problem (2 min vs. 40 min) ...

InDesign Server Developers

 

Btw, one other idea comes to mind: are all the required fonts installed on the server?

Re: Is it possible to set a log level for ID and/or IDS when opening an IDML?

$
0
0

When you're opening an IDML-file, the InDesign document is created anew and hyperlinks are created anew too. At the beginning creating a hyperlink takes about 0.1 second, but if the document already contains, say, 20,000+ hyperlinks, it may take about 1,5—2 minutes to make only one hyperlink (no difference whether you create it by script or manually in InDesign). That's the way InDesign works and we can nothing to do with this (in my opinion).

 

— Kas

Re: Is it possible to set a log level for ID and/or IDS when opening an IDML?

$
0
0

The OP reported serious differences between InDesign Desktop (2 minutes) vs. InDesign Server (40 minutes) on the same file.

IMO InDesign Server should always be faster.

Viewing all 37788 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>