Skip navigation
Peter JD Matthews
Currently Being Moderated

docRef.Export bugs?

Aug 27, 2012 9:22 PM

I seem to have found two bugs in docRef.Export for jpg in CS4.

 

I found in posting this that the period marks (full stops) in the filename strings were almost invisible. Since these are crucual to the point I have enclosed then in {} like this "{.}"

 

1. Poor quality jpg exports irrespective of the  QualitySetting value.

 

2. The documentation tells you to supply the file path with no extension - it will be supplied. However Export clearly has a function to strip off the extension should you have left it on. This then is antagonistic to legal windows (7 in my case) file names, since these allow multiple periods in the file name, only the text after the last period being considered the extension. The Export function function strips off everything after any period there is in the filename and then adds jpg.

 

So a file  XYZ{.}ABC{.}ai - which we want to generate XYZ{.}ABC{.}jpg should be supplied as XYZ{.}ABC acording to the documentation - but if this is done the return is XYZ{.}jpg. If XYZ{.}ABC{.}ai is supplied then it gets even stranger, and I am not sure of all the ramifications, but filenames like XYZ{.}AbC abc{.}ai generated output names like XYZ{.}ABC -abc{.}jpg - note the added "-"!

 

I suggest the function should either assume the filename fed it is correct and just add the ".jpg" or the documentation should be changed to require the extension to remain, and the function should strip off the text after the last period and append "jpg".

 

 

Any comments / workarounds?

 
Replies
  • Currently Being Moderated
    Aug 28, 2012 1:40 AM   in reply to Peter JD Matthews

    How about export with regular name, and rename filename after export.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 28, 2012 6:48 AM   in reply to Peter JD Matthews

    When you say quality are you refering to the applied compression or the fact that it's always 72dip as for the export I have always supplied full file path as parameter… You may need to post some code?

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 28, 2012 8:07 AM   in reply to Peter JD Matthews

    exporting with a fixed simple 'fake' name and

    then renaming

     

    Yes, that's what I mean, I haven't test this issue through.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 28, 2012 8:47 AM   in reply to Peter JD Matthews

    The AI way is to output at 72dpi and allow you to scale H&V… I don't recall anyone posting who prefers it this way about…? but there you go… I don't understand what you are saying about export naming though?

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 28, 2012 10:52 PM   in reply to Peter JD Matthews

    What I am saying is… In javaScript… exportFile (exportFile: File, exportFormat: ExportType[, options: any]) 3 parameters…

     

    var jpegOpts = new ExportOptionsJPEG();
    jpegOpts.antiAliasing = true; 
    jpegOpts.qualitySetting = 100;   
    jpegOpts.optimization = true;
    jpegOpts.horizontalScale = 100;
    jpegOpts.verticalScale = 100;
    jpegOpts.artBoardClipping = true;
      
    var jpegPath = File( dF.fsName+'/'+baseName+'_'+abName+'.jpeg' );
     
    docRef.exportFile( jpegPath, ExportType.JPEG, jpegOpts );
    
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 31, 2012 9:25 AM   in reply to Peter JD Matthews

    You should probably make the first artboards rectangle the same as the documents visible bounds ( if theres only one ) or do the math off each artboards rectangle to caluclate sizes… Never seen this issue of file naming before so my guess it is VB related?

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points