-
1. Re: Export JPEG
sudar1983_14 Apr 26, 2009 9:40 PM (in response to Ken Krugh)Hi,
In CS3 there is no option to convert selected item to jpeg with preferences (CS3 bug)
So, You have to resize the page to jpg size and then export with page as jpg.
Regards,
Sudar
-
2. Re: Export JPEG
pkahrel Apr 27, 2009 1:23 AM (in response to sudar1983_14)> In CS3 there is no option to convert selected item to jpeg with preferences (CS3 bug)
That's not true: in CS3, in JavaScript, app.jpegExportPreferences.resolution = 300 works fine. Maybe it's a VB problem.
Peter
-
3. Re: Export JPEG
sudar1983_14 Apr 27, 2009 2:01 AM (in response to pkahrel)Hi,
Is it your code working fine then can you please send your code. I have a problem with my code.
aDoc=app.activeDocument;
selTextFrame=aDoc.pages.item(0).textFrames.item(0);
app.jpegExportPreferences.resolution = 300;
selTextFrame.exportFile(1246775072, "D:\\test.jpg", false);
Regards,
Sudar
-
4. Re: Export JPEG
pkahrel Apr 27, 2009 4:33 AM (in response to sudar1983_14)Your code works fine. What's your problem?
Peter
-
5. Re: Export JPEG
Ken Krugh Apr 27, 2009 4:46 AM (in response to pkahrel)No file gets produced. The only way I've been able to produce a file is by using the export command on the selection object. But THEN, the JPEG export preferences seem to be ignored.
-
6. Re: Export JPEG
pkahrel Apr 27, 2009 5:14 AM (in response to Ken Krugh)> No file gets produced.
Maybe you need a file object rather than a string. In JS you create a file object like this: File ('d:\\test.jpg'). I'd have expected that this was required in JS, but it worked on a simple string as well as on a file object. Maybe VB needs a file object.
Peter
-
7. Re: Export JPEG
sudar1983_14 Apr 27, 2009 5:30 AM (in response to pkahrel)Hi Peter,
It is javascript code.
It will produce a file, but the resolution is 72. Here the question is, it will support the preferences or not?
Regards,
Sudar
-
8. Re: Export JPEG
sudar1983_14 Apr 27, 2009 6:59 AM (in response to sudar1983_14)Hi Ken,
This is the code for VB, You have to set jpg size to the page and then export page as jpg then you get what you are expected.
Here oFigureGroup is the selected item, oInDoc is the indesign document, olPg is the current page
oFOGeo = oFigureGroup.GeometricBounds
oPgHeight = oInDoc.DocumentPreferences.PageHeight
oPgWidth = oInDoc.DocumentPreferences.PageWidth
oInDoc.DocumentPreferences.PageHeight = oFigureGroup.GeometricBounds(2) - oFigureGroup.GeometricBounds(0)
oInDoc.DocumentPreferences.PageWidth = oFigureGroup.GeometricBounds(3) - oFigureGroup.GeometricBounds(1)
oFigureGroup.GeometricBounds = oIPg.Bounds
oIndsn.JPEGExportPreferences.Resolution = 300
oIndsn.JPEGExportPreferences.JPEGExportRange = idExportRangeOrAllPages.idExportRange
oIndsn.JPEGExportPreferences.PageString = oIPg.Name
oInDoc.Export idExportFormat.idJPG, "d:\test.jpg", False
oInDoc.DocumentPreferences.PageHeight = oPgHeight
oInDoc.DocumentPreferences.PageWidth = oPgWidth
oFigureGroup.GeometricBounds = oFOGeo
Please let me know any other requires.
Regards,
sudar
-
9. Re: Export JPEG
SuperMacGuy Apr 27, 2009 7:20 AM (in response to Ken Krugh)I had reported about 6 months ago that Applescript, on exporting selection, ignores the preferences. It was confirmed as a bug by an Adobe engineer, to me directly. I guess it also affects VB. As stated by another poster, you have to export the entire page to use the export preferences/dpi/quality/etc.
-
10. Re: Export JPEG
pkahrel Apr 27, 2009 2:59 PM (in response to SuperMacGuy)Well, JavaScript in CS3 and CS4, on Windows XP, exports the referenced text frame as expected, i.e. Sudhar's code works fine for me.
Peter
-
11. Re: Export JPEG
SuperMacGuy Apr 28, 2009 5:21 AM (in response to pkahrel)Ah OK, it's just an Applescript bug then. Thanks for (re) clarifying.
-
12. Re: Export JPEG
sudar1983_14 Apr 28, 2009 6:04 AM (in response to SuperMacGuy)Hi All,
In Javascript it will produce a jpg file, there is no doubt about it, but jpgpreferences are ignored, so resolution should be 72 only. It is actually Indesign CS3 bug.
regards,
sudar
-
13. Re: Export JPEG
pkahrel Apr 28, 2009 6:53 AM (in response to sudar1983_14)Sudar,
Again, you're wrong: Bridge and PhotoShop tell me that the JPEG of exported referenced frame (using the literal code you posted earlier) has the resolution set in the script. How do you determine the resolution of the exported file?
Peter
-
14. Re: Export JPEG
Dave Saunders Apr 28, 2009 8:04 AM (in response to pkahrel)Peter,
Where's your passion? Sudar is shouting very loudly. I wonder if you are being heard at all.
Sardonic grin.
Dave
-
15. Re: Export JPEG
sudar1983_14 Apr 28, 2009 8:06 AM (in response to pkahrel)Hi Peter,
Im using Irfan view to see the resolution.
Regards,
sudar
-
16. Re: Export JPEG
AdobeScripts May 7, 2009 5:17 AM (in response to sudar1983_14)sudar1983_14 wrote:
Im using Irfan view to see the resolution.
ROTFL
IrfanView isn't Maste-Of-All-Graphics-Applications
so you should check your file in other applications before you shout so loud
robin
www.adobescripts.co.uk
-
17. Re: Export JPEG
sudar1983_14 May 7, 2009 5:26 AM (in response to AdobeScripts)Hi Adobe,
This is my code,
aDoc=app.activeDocument;
selTextFrame=aDoc.pages.item(0).textFrames.item(0);
app.jpegExportPreferences.resolution = 300;
selTextFrame.exportFile(1246775072, "D:\\test.jpg", false);
Plese find the attachment, ie exported jpg file.
Regards,
sudar
-
test.jpg 64.3 K
-



