🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.scripting.indesign
2 messages
2 total messages Started by JIM_PAQUET Fri, 09 Jan 2009 19:12
COMBINE 3 INDESIGN PAGES INTO I
#2167
Author: JIM_PAQUET
Date: Fri, 09 Jan 2009 19:12
1 lines
870 bytes
Hi, I'm looking to resize and place 2 indesign CS3 pages (front and back of post cards-can be sized at 5.625" x 3.625" or 6.125" x 4.375") onto a 3rd 8.5" x 11" indesign page that contains the front and the back of the cards with additional copy. It is the way we currently submit proofs to our clients for approval as a single page that they in turn fax back to us. Thanks for any help on this.
Re: COMBINE 3 INDESIGN PAGES INTO I
#2184
Author: loic_aigon
Date: Sat, 10 Jan 2009 23:41
70 lines
2706 bytes
Hi I tried something. Let me know if it helped.
Loic

if(app.documents.length!=0)
{
	try
	{
		//Get Postcard doc attributes
		var doc= app.documents[0].getElements()[0];
		var docFile = File(doc.fullName);
		var docName = doc.name.split(".indd")[0];
		var docFolder = Folder(docFile.parent);

		//Add a temporary document & set dimensions
		var tempdoc = app.documents.add();
		with(tempdoc)
		{
			documentPreferences.pageWidth="8.5";
			documentPreferences.pageHeight="11";
		}



		//Create the imported document first's recipient & place the page 1 of the postcard document
		var r1 = tempdoc.rectangles.add({geometricBounds:[0.75,1.1875,5.125,7.3125]});
		app.importedPageAttributes.pageNumber = 1;
		r1.place(docFile,false);
		fitMe(r1);

		//Create the imported document second's recipient & place the page 2 of the postcard document
		var r2 = tempdoc.rectangles.add({geometricBounds:[5.2525,1.1875,9.6345,7.3125]});
		app.importedPageAttributes.pageNumber = 2;
		r2.place(docFile,false);
		fitMe(r2);

		//Create a text frame for other infos
		var r3 = tempdoc.textFrames.add({contents:"Please Fax us back your approval as soon as possible at 555-8000-210",geometricBounds:[9.8325,1.1875,10.5,7.3125]});

		//Export to PDF and display the created file		
		var myPDFfile = docFolder+"/"+docName+".pdf";
		app.pdfExportPreferences.viewPDF = true;
		exportPDF(myPDFfile,"[PDF/X-1a:2001]",tempdoc);

		//Close the temporary document without saving it.
		tempdoc.close (SaveOptions.NO, undefined, undefined, false);
	}
	catch(e)
	{
		//In case of a error...
		alert(e);
	}
}
else
{
	alert("You don't have any Indesign documents open !");
}

//Quite obvious function
function exportPDF(myPdfFile,myPdfPreset,doc)
{
	doc.exportFile (ExportFormat.PDF_TYPE, myPdfFile, false, myPdfPreset, undefined, undefined, false);
}

//Fit placed documents into the recipients
function fitMe(monObjet)
{
	monObjet.fit(FitOptions.PROPORTIONALLY);
	monObjet.fit(FitOptions.CENTER_CONTENT);
	monObjet.fit(FitOptions.FRAME_TO_CONTENT);
}
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads