Copy link to clipboard
Copied
hi, it exist lot of nice script for export to pdf but, i need to integrate it into my script
2 possiblity, i write it into my actual big script after update all link by recusrion, we can export the "etiquette fini.indd" file
or i write a script with scan mask function for open only the "etiquette fini.indd" file name (name existing in 70 version file with 70 path different), and i export only this file to pdf interactive?
thanks for your help
i m so close to finish my job
Copy link to clipboard
Copied
Exporting pdf is just a few lines of code, so I would suggest add it to your bigger script that does all the relinking and before closing the INDD file export the pdf as well
-Manan
Copy link to clipboard
Copied
ok because pdf export can generate some crash it s maybe better to use this function separatly?
Copy link to clipboard
Copied
Why would it crash? And if it does crash under some circumstance then it will crash even if you keep the PDF export code in a seperate file. I again suggest to you don't shift your focus to multiple goals. First target to create a workable script and then keep on adding error handling, doing refactoring etc as and when needed otherwise you will keep looking for alternatives
-Manan
Copy link to clipboard
Copied
because before, i used native function export to pdf
if my file have just some page, it work
but i have try to export my catalogu, and it crash at 100% each time, i have do it with pdf interactive, and it work
support adobe have check during several day, and never find the reason...
Copy link to clipboard
Copied
Hi @laurence roussel12011930 ,
it may help to look into the code of Peter Kahrel's script Batch Process:
https://creativepro.com/files/kahrel/indesign/batch_convert.html
See also into DOM documentation:
Regards,
Uwe Laubender
( Adobe Community Expert )
Copy link to clipboard
Copied
ok, we can test name file, if we will close "étiquette finie.indd" we will export it to pdf
Copy link to clipboard
Copied
You may as well consider the sample from the official documentation (cf P55) : https://usermanual.wiki/adobe/InDesigncs6ScriptingJSEN.3768967468/view
Although the doc is CS6 old, the method didn't move much.
Copy link to clipboard
Copied
Exporting PDF with interactive featuresThe following script exports a document with interactive features as a PDF. (For the complete script, see ExportInteractivePDF.)//Given a document "myDocument," add page transitions...for(var myCounter = 0; myCounter < myDocument.spreads.length; myCounter++){myDocument.spreads.item(myCounter).pageTransitionType PageTransitionTypeOptions.wipeTransition;myDocument.spreads.item(myCounter).pageTransitionDirection =PageTransitionDirectionOptions.down;myDocument.spreads.item(myCounter).pageTransitionDuration =PageTransitionDurationOptions.medium;}app.interactivePDFExportPreferences.flipPages = true;app.interactivePDFExportPreferences.flipPagesSpeed = 5;app.interactivePDFExportPreferences.openInFullScreen = true;app.interactivePDFExportPreferences.interactivePDFInteractiveElementsOption =InteractivePDFInteractiveElementsOptions.includeAllMedia;//Export the document to PDF.myDocument.exportFile(ExportFormat.interactivePDF,File(Folder.desktop + "/InteractivePDF.pdf"), false);
we are right i can use this code because it s write:
Copy link to clipboard
Copied
There is a fundamental difference between exporting to interactive PDF and exporting to PDF. The first one intends to output PDFs for digital distribution (hence interactive as you may find hyperlinks and so on), typically images are dramatically downsized and color space is RGB. Export to PDF is more print oriented. The two export format mimicks the capacity of the user to choose the PDF format (s)he wants to use.
Copy link to clipboard
Copied
sorry i don t ask if there is difference between pdf interactive and pdf for print i ask for
ExportInteractivePDF and Exporting PDF with interactive features
because in your manual it s not clear for me
Exporting PDF with interactive featuresThe following script exports a document with interactive features as a PDF. (For the complete script, see ExportInteractivePDF.
i do not see ExportInteractivePDF into your maual
and about diffence pdf and pdf interactiv, i can t export my catalogu to pdf wihtout crash at 90%,and i can only with interactive
support adobe have search during 3 day with me for understand without never find solution...
Copy link to clipboard
Copied
Sorry if I misunderstood the need at the first place. Yes ExportInteractivePDF equals Exporting PDF with interactive features in the UI.
If you are facing crash with the regular PDF export, I would suggest that you do export to PDF manually but using page ranges until you can find the page (hopefully only one) that causes the crash and check on the page content what is the problem.
Crashes are not a typical behaviour but maybe something is preventing PDF creation like a font embedding licence issue, a corrupted graphic…Unless you can export to PDF manually without crash, I won't spend time at first investigating the script.
FWIW
Loic
Copy link to clipboard
Copied
i have do that, but it not determine wich page exactly, because, i have try to remove all link into this page (1 page = 1 link) and it was same problem
but with interactif there is not problem,
now i need just to understand how to insert the good few line into my script for:
export with same name in same folder than "source", and overwrite if existing
and there is no problem for missunderstand, my english is really not clear...
Copy link to clipboard
Copied
Something you can do, call it the last chance operation is to export file to idml (manually), open this idml to get a brand new InDesign document and export to PDF again. If it does work, it may signify something was corrupted in your genuine document and that you got it fixed.
If it didn't, you need to isolate once again the source of the problem. If you do segmented pdf exports, you should eventually isolate the culprit.
If something is wrong with your file, you will never get it right with scripting.
The fact that it works with interactive is interesting tough. It might be a performance issue (full disks, network latencies while writing). Can you export to your file system (not network) and see if crash occurs?
Copy link to clipboard
Copied
we do that with adobe support
we have try all
Copy link to clipboard
Copied
Well, I have tried too here but there is something for sure. If you have a colleague, maybe you can ask him/her to export from his/her machine to see if problem persists.
Nothing better for now.
Copy link to clipboard
Copied
we have try with an other machine... we have try to export assembly file, we have try idml, i have try range page..
suport adobe take control to my computer during 2 day....
they have download the file, and answer me they don t have problem to their side..... only on our network
pdf interactif is the alone solution....
Copy link to clipboard
Copied
See : "answer me they don t have problem to their side..... only on our network" That's why I asked for any network issues. If there are latencies in the network, InDesign may crash during I/O operations.
Try this : package your indesign document to a local folder (C:/… or ~/Documents) so every single resource is not on the network. Then open the local indd file and export.
Also be aware than antivirus can be a pain in the ass for I/O network operations. I have seen scripts widely slowed down for that.
Copy link to clipboard
Copied
impossible all my ressource are on net work
folder is too big for to be transfered
Copy link to clipboard
Copied
can you just try to explain me or help to me to adapt this few line for put into my script for export my document as interactive pdf?
it s my last step for finish this script
thanks in advance see you later
Copy link to clipboard
Copied
I gave you doc sample, it's basically copying/pasting from there.
Copy link to clipboard
Copied
The code that you picked up from the pdf shared by @Loic.Aigon is good enough to be used. The only things you need to edit are
var myDocument = app.documents[0] //Or set it with or replace it with the document object you might have
for (var myCounter = 0; myCounter < myDocument.spreads.length; myCounter++) {
myDocument.spreads.item(myCounter).pageTransitionType PageTransitionTypeOptions.wipeTransition;
myDocument.spreads.item(myCounter).pageTransitionDirection = PageTransitionDirectionOptions.down;
myDocument.spreads.item(myCounter).pageTransitionDuration = PageTransitionDurationOptions.medium;
}
app.interactivePDFExportPreferences.flipPages = true;
app.interactivePDFExportPreferences.flipPagesSpeed = 5;
app.interactivePDFExportPreferences.openInFullScreen = true;
app.interactivePDFExportPreferences.interactivePDFInteractiveElementsOption = InteractivePDFInteractiveElementsOptions.includeAllMedia;
myDocument.exportFile(ExportFormat.interactivePDF,File(Folder.desktop + "/InteractivePDF.pdf"), false); //Change the file path and file name as needed
-Manan
Copy link to clipboard
Copied
ok i do that
function exporttopdf(doc) {
var myDocument = app.activeDocument[0] //Or set it with or replace it with the document object you might have
for (var myCounter = 0; myCounter < myDocument.spreads.length; myCounter++) {
myDocument.spreads.item(myCounter).pageTransitionType PageTransitionTypeOptions.wipeTransition;
myDocument.spreads.item(myCounter).pageTransitionDirection = PageTransitionDirectionOptions.down;
myDocument.spreads.item(myCounter).pageTransitionDuration = PageTransitionDurationOptions.medium;
}
app.interactivePDFExportPreferences.flipPages = true;
app.interactivePDFExportPreferences.flipPagesSpeed = 5;
app.interactivePDFExportPreferences.openInFullScreen = true;
app.interactivePDFExportPreferences.interactivePDFInteractiveElementsOption = InteractivePDFInteractiveElementsOptions.includeAllMedia;
myDocument.exportFile(ExportFormat.interactivePDF,File(Folder.desktop + "/InteractivePDF.pdf"), false); //Change the file path and file name as needed
}
just filepath, and name i don t know how to recuperate the same place than folder.doc.filePath and same name with pdf
and i call this function after openandupdate(doc)
i see into line, "flip page", but we are agree, it s not a flipbook like that:
https://fr.calameo.com/laboratoire-phykidis/read/0069039871ed71cc320d5
?
Copy link to clipboard
Copied
nothing
Copy link to clipboard
Copied
Try the following code. It will export the pdf in the same folder where the indd file is saved and save it with the name of indesign file. I have called the method for the currently active document, you can change the argument as needed according to your script
function exporttopdf(doc) {
for (var myCounter = 0; myCounter < doc.spreads.length; myCounter++) {
doc.spreads.item(myCounter).pageTransitionType = PageTransitionTypeOptions.wipeTransition;
doc.spreads.item(myCounter).pageTransitionDirection = PageTransitionDirectionOptions.down;
doc.spreads.item(myCounter).pageTransitionDuration = PageTransitionDurationOptions.medium;
}
app.interactivePDFExportPreferences.flipPages = true;
app.interactivePDFExportPreferences.flipPagesSpeed = 5;
app.interactivePDFExportPreferences.interactivePDFInteractiveElementsOption = InteractivePDFInteractiveElementsOptions.includeAllMedia;
var fName = doc.name.replace(/\.indd/, ".pdf")
doc.exportFile(ExportFormat.interactivePDF, File(doc.filePath.fsName + "/" + fName), false);
}
exporttopdf(app.documents[0])
Regarding the flip option, you should be able to comment those line and thing should work, try it once you have the export code working
-Manan
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more