Click here to Skip to main content
15,902,840 members
Home / Discussions / C#
   

C#

 
AnswerRe: Windows service using C# Pin
Manas Bhardwaj17-Sep-08 1:21
professionalManas Bhardwaj17-Sep-08 1:21 
GeneralRe: Windows service using C# Pin
Mohammed Hameed17-Sep-08 1:56
professionalMohammed Hameed17-Sep-08 1:56 
AnswerRe: Windows service using C# Pin
#realJSOP17-Sep-08 4:39
professional#realJSOP17-Sep-08 4:39 
GeneralRe: Windows service using C# Pin
Mohammed Hameed18-Sep-08 23:58
professionalMohammed Hameed18-Sep-08 23:58 
AnswerRe: Windows service using C# Pin
PIEBALDconsult17-Sep-08 6:37
mvePIEBALDconsult17-Sep-08 6:37 
GeneralRe: Windows service using C# Pin
Mohammed Hameed18-Sep-08 23:59
professionalMohammed Hameed18-Sep-08 23:59 
GeneralRe: Windows service using C# Pin
PIEBALDconsult19-Sep-08 5:20
mvePIEBALDconsult19-Sep-08 5:20 
QuestionExport single Pages from a .indd file Pin
frostii17-Sep-08 0:50
frostii17-Sep-08 0:50 
hi all

i'm working on a project that should export every single page from an indesign cs2 file as a pdf.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using InDesign;

namespace trisa_indesign
{

    public partial class frm_TrisaElectro : Form
    {
        public frm_TrisaElectro()
        {
            InitializeComponent();
        }

        //Com Objekt einbinden
        public static object COMCreateObject(string sProgID)
        {
            // We get the type using just the ProgID
            Type oType = Type.GetTypeFromProgID(sProgID);
            if (oType != null)
            {
                return Activator.CreateInstance(oType);
            }

            return null;
        }


        //Ereignisse
        private void cmd_save_Click(object sender, EventArgs e)
        {
            func_objcreate();
        }


        //funktionen
        
        //Objekte erzeugen
        public void func_objcreate()
        {
            //objekte erzeugen: Com, Aktives Dokument
            InDesign.Application objApp = (InDesign.Application)COMCreateObject("Indesign.Application");
            InDesign.Document objDoc = objApp.ActiveDocument;
            //aufruf der export methode mit übergabe des com und doc objektes
            func_HighExport(objApp, objDoc);
        }

        //PDF Files exportieren
        public void func_HighExport(InDesign.Application tmpApp, InDesign.Document tmpDoc)
        {   
            //filename auslesen
            string sfileName = Convert.ToString(tmpDoc.Name);
            //zählschleife für die 8 seiten des dokuments
            for (int i = 1; i <= tmpDoc.Pages.Count; i++)
            {
                //speicherpfad festlegen
                string sSavePath = @"C:\trisaprojekt\" + sfileName + Convert.ToString(i) + ".pdf";
                //momentane seitenzahl festlegen
                InDesign.Page objPage = (InDesign.Page)tmpDoc.Pages[i];
                //pdf exportieren
                tmpDoc.Export(idExportFormat.idPDFType, sSavePath, false, tmpApp.PDFExportPresets["[PDF/X-3:2002]"]); //"[PDF/X-3:2002] (geändert)"  "[Kleinste Dateigröße]"
                
                /*
                 * for(var myCounter = 0; myCounter < myDocument.pages.length; myCounter++){
                myPageName = myDocument.pages.item(myCounter).name;
                app.pdfExportPreferences.pageRange = myPageName;
                 */
            }
        }


    }

}


plz ignore the comments in german Wink | ;) and the code between /* */ is a javascript sample.

now the command: InDesign.Page objPage = (InDesign.Page)tmpDoc.Pages[i];
should select everypage beginning with 1 to the max number of pages and then export them. but of course i doenst work.

can anyone give me a hint or something what i'm doing wrong?

kind regards
Questionevent id for system reboot Pin
George_George17-Sep-08 0:44
George_George17-Sep-08 0:44 
QuestionReading csv file into a dataTable Pin
Muammar©17-Sep-08 0:38
Muammar©17-Sep-08 0:38 
AnswerRe: Reading csv file into a dataTable Pin
Ashfield17-Sep-08 1:18
Ashfield17-Sep-08 1:18 
GeneralRe: Reading csv file into a dataTable Pin
Muammar©17-Sep-08 1:25
Muammar©17-Sep-08 1:25 
GeneralRe: Reading csv file into a dataTable Pin
Ashfield17-Sep-08 2:11
Ashfield17-Sep-08 2:11 
AnswerRe: Reading csv file into a dataTable Pin
Colin Angus Mackay17-Sep-08 2:16
Colin Angus Mackay17-Sep-08 2:16 
GeneralRe: Reading csv file into a dataTable Pin
Muammar©17-Sep-08 4:53
Muammar©17-Sep-08 4:53 
GeneralRe: Reading csv file into a dataTable Pin
PIEBALDconsult17-Sep-08 5:22
mvePIEBALDconsult17-Sep-08 5:22 
GeneralRe: Reading csv file into a dataTable Pin
Muammar©17-Sep-08 13:37
Muammar©17-Sep-08 13:37 
GeneralRe: Reading csv file into a dataTable Pin
PIEBALDconsult17-Sep-08 16:44
mvePIEBALDconsult17-Sep-08 16:44 
QuestionGet a value ID from a ListBox,which is bind to a Data source. Pin
CJGun16-Sep-08 23:06
CJGun16-Sep-08 23:06 
AnswerRe: Get a value ID from a ListBox,which is bind to a Data source. Pin
CJGun17-Sep-08 19:15
CJGun17-Sep-08 19:15 
Questioncsv imports Pin
rahuladya16-Sep-08 23:05
rahuladya16-Sep-08 23:05 
AnswerRe: csv imports Pin
Giorgi Dalakishvili16-Sep-08 23:14
mentorGiorgi Dalakishvili16-Sep-08 23:14 
GeneralRe: csv imports Pin
Alan Balkany17-Sep-08 4:15
Alan Balkany17-Sep-08 4:15 
GeneralRe: csv imports Pin
Giorgi Dalakishvili17-Sep-08 4:21
mentorGiorgi Dalakishvili17-Sep-08 4:21 
AnswerRe: csv imports Pin
Mohammed Hameed17-Sep-08 1:00
professionalMohammed Hameed17-Sep-08 1:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.