I am trying to export the page of the document. I am facing issues both in exporting the page or even exporting an item of the PAGE of the document
While exporting a Page of the Document:
app = win32com.client.Dispatch("InDesign.Application.CS6")
doc = app.Documents(1)
app.jpegExportPreferences.exportResolution = 150
page = doc.Pages(1)
page.Export(1699761735,f'{folder_selected}/test.png')
ERROR
Traceback (most recent call last):
File "c:\Users\Sofia\Desktop\C.py", line 85, in <module>
page.Export(1699761735,f'{folder_selected}/test.png')
File "C:\Users\Sofia\AppData\Local\Programs\Python\Python39\lib\site-packages\win32com\client\dynamic.py", line 511, in __getattr__
raise AttributeError("%s.%s" % (self._username_, attr))
AttributeError: <unknown>.Export
While Exporting an Item of the Page:
app = win32com.client.Dispatch("InDesign.Application.CS6")
doc = app.Documents(1)
app.jpegExportPreferences.exportResolution = 150
page = doc.Pages(1)
items = page.PageItems(1)
items.Export(1699761735,f'{folder_selected}/test.png')
It works fine, But it exports a single item, I can change the item but I want the whole page to export.
The Actual Page:
The results after exporting an Item:
It works fine if I export as PDF. But I want it in JPG or PNG format. Any solutions Please?