Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

How to give Page break in XML

Community Beginner ,
Jan 12, 2010 Jan 12, 2010

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.

TOPICS
Scripting
9.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Jan 12, 2010 Jan 12, 2010

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

Translate
Participant ,
Jan 12, 2010 Jan 12, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jan 12, 2010 Jan 12, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 25, 2012 Oct 25, 2012
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines