InDesign Script for identifying and replacing images of indd document - adobe-indesign

I am using InDesign CS6 server for changing text and images of .indd files.
Though I have got scipt for changing texts but I am not able to change the images of indd document.
Can some one plz help me out with script for identifying all the images used in indd doc and then replacing these images with user selected images.
Thanks!!!!

Assuming you have a simple layout containing one linked graphic, the following script would relink that graphic to a different file:
set replacementFile to "Macintosh HD:Users:me:Desktop:somefile.png"
tell application "InDesignServer"
tell document 1
relink link 1 to alias replacementFile
end tell
end tell

Related

Generate single PDF from multiple Asciidoc files

I'm trying to convert my existing asciidoc documentation into pdf. Asciidoctor-pdf seems quite easy and I'm able to convert single files into pdf.
asciidoctor-pdf -a pdf-theme='./theme/styles.yml' -a pdf-fontsdir='GEM_FONTS_DIR, theme/fonts/' 01-intro.adoc
But my docs are spread across many files. I want do create a single pdf from all those files. Does anyone know how to do this?
Secondly I don't want the generated pdf to be located next du the adoc file. I want to specify a target path.
I'd appreciate every hint. Thanks and best regards. Sebastian
(Dec 26, 2021)
The easiest and most convenient way is to use the VSCode editor with the AsciiDoc extension installed. This extension is developed by the same team that develops the AsciiDoctor text processor. This is a GUI-based approach to solve all your problems so I'm pretty sure u're gonna love it.
(Step 1) After the extension is installed, use the keyboard shortcut Cmd + , to go to the settings and then enter asciidoc.use_asciidoctorpdf in the search bar and tick the check box (see the demonstration below)
(Step 2) To create a single pdf file from multiple .adoc files, just simply put all of them in a single .adoc file with include::directory-to-the-adoc-file.adoc[] (see the illustration below)
(Step 3) Press F1, then type in as pdf and hit Enter to export this single .adoc file as a single PDF file, this will allow u to specify the target export directory for the PDF. Please be patient and wait for a few seconds for the export to complete, the editor will immediately inform u as soon as the export is complete (see the image at the bottom)
Have you considered to work with includes?
Just add to your document "01-intro.adoc" an any position this line:
include::02-next-file.adoc[]
When you build the 01-intro.adoc with your regular command, the contents of 02-next-file.adoc will be put to the position of the include line. Using this method we create a file with many includes and just build that file. We're very happy with that.

Scripting ABBYY FineREader with AppleScript

The latest version of ABBYY FineReader for OS X now supports AppleScript. I try to write a simple script that does an OCR of a given pdf document and saves it as a pdf document to make it searchable. Unfortunately, I'm a beginner in AppleScript and can't get it to work. I couldn't find further documentation or samples for scripting ABBYY FineReader.
I managed to open the dictionary of FineReader, it has this function:
export to pdf v : Converts the current document to a PDF file. If FineReader is running in a Sandbox, the file will be saved to a temporary directory.
export to pdf file : NO_DESCRIPTION
[ocr languages enum language list type] : List of recognition languages that includes language identifiers and full language names.
[saving type save settings enum] : Specifies file creation settings for saving results.
[export mode pdf layout] : Specifies export mode.
[keep page numbers headers and footers boolean] : Keeps headers, footers and page numbers.
[page size page size enum] : Specifies paper size.
[keep pictures boolean] : Keeps pictures in recognized document.
[image quality image quality enum] : Specifies quality of pictures in output file.
[keep text and background colors boolean] : Keeps background and character colors.
[use mrc boolean] : Compresses the output file significantly while retaining high quality of text and images.
[make pdfa boolean] : Creates a searchable PDF document that is well suited for archiving.
[create outline boolean] : Creates a table of contents in a PDF file based on headings.
[enable pdf tagging boolean] : Enables PDF tags.
[embed fonts boolean] : Embeds fonts from the document in the e-book.
→ file :
I tried this script:
tell application "FineReader OCR Pro"
export to pdf "<path to pdf>"
end tell
However, I get the output "missing value". What is wrong?
Looks like you may need to supply a path to save the pdf to.
Try this:
tell application "FineReader OCR Pro"
export to pdf ((path to desktop) as string) & "test-export.pdf"
end tell
Should save file to your desktop

Maintain InDesign CS5.5 Import settings w/ XMPie

We are trying to use XMPie to dynamically bring in pdf files and center them within a frame. However, in a manner similar to Photoshop the files are being imported by Bounding box and not allowing us to set any other parameters. We can get it to work on an individual level by importing the file but InDesign nor XMPie will remember these settings. Any help would be appreciated.
We need these to import by Media Box and center & we are using InDesign CS5.5.
Thanks.
What you need to do is to delete everything outside of the visible pdf page size and then place it. I use step and repeat to the same page size by quite imposing in acrobat.

InDesign to output PDF containing multiple copies in a single page of the same InDesign artwork

For example if I have a business card design done in InDesign and now I need to provide print ready PDF for printers containing multiple copies of the business card. How would you do that? Are there any specific tools?
InDesign doesn't do imposition (placing of pages on one output page in a particular order).
You have to buy/find a tool, a plugin. Like croptima dot com.
Or on this page, there's some interesting stuff:
http://www.adobe.com/cfusion/exchange/index.cfm?l=6&s=5&o=desc&exc=19&cat=223&event=producthome
Alternatively do it by hand, or use a pdf imposition tool.
Succes!
Do an export to PDF ( with any marks you need ). Get the file path. Open a text file and type in :
file
/myFile.pdf
/myFile.pdf
/myFile.pdf
/myFile.pdf
/myFile.pdf
/myFile.pdf
/myFile.pdf
…
Once that done. Go to Indesign, set a box that will host the pdf and run a data merge. You will get your imposition quite freely ;)
Loic
My bad, you need to specify that you are placing images files with a trailing arobase :
#pdfs
"/myFile.pdf"
"/myFile.pdf"
"/myFile.pdf"
…
And specify the absolute path to the file.
How many cards do you need to layout ? If few, you could just flow the indd file into another document and duplicate boxes.
I didn't test but maybe you could draw a grid and point for the indesign file. Best scenario, if grid is selected, the file is flowed in every frame.
Loic

Decompress "wmz" file

When we try to save msword doc file as html file we get "wmz" files for the math equation objects.
I tried decompressing the wmz file and saving the content as jpg.
I can open this jpg file in the "Microsoft Picture manager" properly. But trying to open the file in browser displays the error message "The image cannot be displayed, because it contain errors".
What is the procedure to decompress this wmz file and convert it to jpg.
What will be the extension of decompressed file?
.WMZ seems to be a zipped .WMF file.
You can open the unzipped file with a picture view/editor (just tried IrfanView) and save as .jpg.
When you save your Word documents as "Web Page, filtered" you won't get these WMZ files but just PNG files.
Set the "Web Options" to target to a low version of IE (i.e. 4.0) and check "allow PNG files" and "disable features not supported by these browsers".
Added advantage is that the webpage will display better in different browsers.
However, you should do all of this after you first make a copy of your document (and associated files) using Explorer into another location. Open this copy with Word and then Save as "Web Page, filtered". The original you keep for editing. (Don't save the original as a "web page, filtered" or you will loose the ability to edit the equation objects).
Thanks for the help.
Finally i could not remove the black background from the image file.
So using the round about approach for now
1)Decompress the wmz file to byte array(wmf).
2)Open a new word document
3)Paste the byte array into word document.(this document should only contain this data, and no other extra information)
4)Save the doc as html file (WdSaveFormat.wdFormatFilteredHTML)
5)open the "_files" directory created for the html output
6)Find the only "gif" file created inside the directory

Resources