지금 당분간이 문제가 발생했습니다. 내 "교정"스크립트의 끝 부분에서 InDesign에서 현재 열려있는 문서는 두 개의 다른 .pdf 파일로 내보내집니다. 첫 번째 암호는 암호로 보호되며 두 번째 암호는 암호로 보호되지 않습니다. 후자에 문제가있는 것 같지 않지만 전자는 종종 손상되어 Acrobat 자체를 비롯하여 모든 PDF 판독기에서 열 수 없습니다. 여기에 수출 수행하는 코드 블록이다 (이 BTW, 그 자체로 하지 실행 가능한 것입니다) :InDesign ExtendScript 스크립트가 내보내기 도중 손상된 PDF를 생성하는 경우가 있습니다.
/********** BEGIN PDF EXPORTING **********/
// First, let's create and set PDF export preferences.
// This begins with creating a temporary preset if it doesn't already exist.
// This preset will be used for both the Proof page and the Cover sheet.
var tempPreset = app.pdfExportPresets.item("tempPreset");
try
{
tempPreset.name;
}
catch (eNoSuchPreset)
{
tempPreset = app.pdfExportPresets.add({name:"tempPreset"});
}
with (tempPreset)
{
acrobatCompatibility = AcrobatCompatibility.ACROBAT_5;
bleedMarks = false;
colorBars = false;
colorBitmapCompression = BitmapCompression.AUTO_COMPRESSION;
colorBitmapQuality = CompressionQuality.MAXIMUM;
colorBitmapSampling = Sampling.BICUBIC_DOWNSAMPLE;
colorBitmapSamplingDPI = 300;
compressTextAndLineArt = true;
cropImagesToFrames = true;
cropMarks = false;
exportGuidesAndGrids = false;
exportNonprintingObjects = false;
exportReaderSpreads = false;
exportWhichLayers = ExportLayerOptions.EXPORT_VISIBLE_PRINTABLE_LAYERS;
generateThumbnails = false;
grayscaleBitmapCompression = BitmapCompression.AUTO_COMPRESSION;
grayscaleBitmapQuality = CompressionQuality.MAXIMUM;
grayscaleBitmapSampling = Sampling.BICUBIC_DOWNSAMPLE;
grayscaleBitmapSamplingDPI = 300;
includeBookmarks = false;
includeHyperlinks = false;
includeSlugArea = false;
includeStructure = true;
monochromeBitmapCompression = MonoBitmapCompression.CCIT4;
monochromeBitmapSampling = Sampling.BICUBIC_DOWNSAMPLE;
monochromeBitmapSamplingDPI = 1200;
omitBitmaps = false;
omitEPS = false;
omitPDF = false;
optimizePDF = true;
pageInformationMarks = false;
pageMarksOffset = 0.0833;
pdfMarkType = MarkTypes.DEFAULT_VALUE;
printerMarkWeight = PDFMarkWeight.P25PT;
registrationMarks = false;
standardsCompliance = PDFXStandards.NONE;
subsetFontsBelow = 100;
thresholdToCompressColor = 450;
thresholdToCompressGray = 450;
thresholdToCompressMonochrome = 1800;
useDocumentBleedWithPDF = false;
}
currentProcess.text = "PDF export preferences"; progressWin.show();
progressIndividual.value++; if (aProducts.length > 1) {progressOverall.value++;}
// Now let's actually set the export preferences. These are for the proof page.
with (app.pdfExportPreferences)
{
pageRange = proofRange;
useSecurity = true;
disallowChanging = true;
disallowCopying = false;
disallowDocumentAssembly = true;
disallowExtractionForAccessibility = false;
disallowFormFillIn = true;
disallowHiResPrinting = true;
disallowNotes = true;
disallowPlaintextMetadata = true;
disallowPrinting = false;
changeSecurityPassword = "sky";
if (multiColor)
{
pageRange = colorTable.toString();
}
if (currentProduct.pLabel != "")
{
pageRange += "," + labelPage.name;
}
}
currentProcess.text = "Exporting PDF proof page"; progressWin.show();
progressIndividual.value++; if (aProducts.length > 1) {progressOverall.value++;}
// Before exporting the Proof page(s), hide the color bar on multicolor products.
if (multiColor) {document.layers.item("COLOR BAR").visible = false;}
// Then we save the proof page.
document.exportFile(ExportFormat.PDF_TYPE, File(jobFolder.toString() + "/" + saveName + ".pdf"), false, tempPreset);
그 동안 한 번 손상된 PDF를 생성 할 때, 나는 아마도 그것은이라고 생각 우리의 이상적이지 네트워크 구조 때문에 문제가 발생했기 때문에 대신 PDF 파일을 네트워크에 직접 연결하지 않고 로컬 하드 드라이브로 내보내고 파일을 네트워크로 옮겼습니다. 따라서 위 코드 블록의 마지막 줄은 다음과 같이 바뀌 었습니다.
// First, to the local HDD.
document.exportFile(ExportFormat.PDF_TYPE, File("~/Documents/" + saveName + ".pdf"), false, tempPreset);
$.sleep(1000);
File("~/Documents/" + saveName + ".pdf").copy(File(jobFolder.toString() + "/" + saveName + ".pdf"));
$.sleep(1000);
File("~/Documents/" + saveName + ".pdf").remove();
심지어 1 초 지연으로 추가되었습니다. 슬프게도, 이것은 도움이되지 못했습니다. 나는 지금도 때때로 손상된 PDF를 받고있다. 손상된 파일에 패턴이있는 경우이를 식별 할 수 없었습니다. 누구든지 어떤 생각을 가지고 있습니까?
내 생각은 : 부패는 어떻게 생겼습니까? 파일에 데이터가 남아 있습니까 (0이 아닌)? 데이터가있는 경우 파일 확장자를 ".txt"로 변경하고 TextWrangler에서 열면 어떻게됩니까? – CRGreen
죄송합니다. 부패가 어떻게 보이는지에 대한 귀하의 제안을 본 적이 없었습니다. 대신 잠시 후에 게시 할 수있는 해결 방법을 만들었습니다. – Sturm