Copy link to clipboard
Copied
Can we give an page break instructions through XML file.
I have an xml file which i am importing and generating pdf.Is there any tag or paragrapg style that can be applied to xml element to indicate page break.
Hi Nishatry
I dont think so there is one command for pagebreaking from indesign. By this way you can try create tag for pagebreaking and apply a paragraph style then simply replace the pagebreak style to pagebreak
app.findTextPreferences = app.changeTextPreferences = null;
app.findTextPreferences.appliedParagraphStyle = "Pagebreak";
app.changeTextPreferences.changeTo = "^P";
app.activeDocument.changeText();
thanks
regards
a r u l
Copy link to clipboard
Copied
Hi Nishatry
I dont think so there is one command for pagebreaking from indesign. By this way you can try create tag for pagebreaking and apply a paragraph style then simply replace the pagebreak style to pagebreak
app.findTextPreferences = app.changeTextPreferences = null;
app.findTextPreferences.appliedParagraphStyle = "Pagebreak";
app.changeTextPreferences.changeTo = "^P";
app.activeDocument.changeText();
thanks
regards
a r u l
Copy link to clipboard
Copied
Hi Nishatry,
You cannot add the Page break as a symbol in XML. Instead you can add element or attribute as "PageBreak".
In InDesign scripting you can find the "PageBreak" elements and insert the pagebreaks by using the following code.
var myDoc = app.activeDocument;
PageBreaking(myDoc);
alert("Page Break Inserted");
function PageBreaking(elm){
for (var i = 0; i < elm.xmlElements.length; i++){
try{
XMLelementName=elm.xmlElements.markupTag.name.toString();
elm.xmlElements.select();
if(XMLelementName=="PageBreak"){
elm.xmlElements.contents = SpecialCharacters.frameBreak;
}
}catch(e){}
PageBreaking(elm.xmlElements);
}
}
I think this is usefull for your requirement.
Regards,
Ramkumar .P
Copy link to clipboard
Copied
Hi! I think you guys are solving a problem I have. I have almost no knowledge of scripting, so bear with me please. It seems to me that if I introduce an element named PageBreak into the XML and then import the XML into indesign CS5, if I then run your script (what kind of script is this? apple, java, etc) then the script will find all PageBreak elements and replace with the frameBreak special character.
Is this correct?
If so, how do I introduce the element PageBreak? What should it look like in the XML document?
Also, can I just copy and paste your script in the applescript editor and run it?
Sorry for my lack of knowledge in this area. This is where I am starting, so I appreciate your help.
Paul
Find more inspiration, events, and resources on the new Adobe Community
Explore Now