Ghostscript (또는 더 구체적으로는 GhostscriptSharp, C# wrapper 버전)를 사용하여 PDF의 축소판을 생성하려고하는데 현재 출력중인 이미지 품질에 문제가 있습니다 . 8의 (12)의 높이와 폭은 예를 들어, 것Ghostscript를 사용하여 고화질 (또는 읽을 수있는) 썸네일 생성
GeneratePageThumbs(string inputPath, string outputPath, int firstPage, int lastPage, int width, int height)
과 대략 썸네일 내가 찾고 있어요 크기를 생성합니다 작은 숫자의 폭과 높이를 변경 :
다음과 같은 방법을 사용하여 102 x 88 픽셀 크기의 축소판 세트를 생성합니다.
이상적으로는 이미지 태그에서 HTML로 렌더링 할 때 100x80 크기의 축소판을 생성하려고합니다. 그래야 독자가 자신이 무엇을보고 있는지에 대한 적절한 생각을 얻을 수 있습니다. (이것은 현재로 완전히 읽을 수) 썸네일
이 현재 (는 C# 래퍼에서) 설정입니다 : 그러나
private static readonly string[] ARGS = new string[] {
// Keep gs from writing information to standard output
"-q",
"-dQUIET",
"-dPARANOIDSAFER", // Run this command in safe mode
"-dBATCH", // Keep gs from going into interactive mode
"-dNOPAUSE", // Do not prompt and pause for each page
"-dNOPROMPT", // Disable prompts for user interaction
"-dMaxBitmap=500000000", // Set high for better performance
"-dNumRenderingThreads=4", // Multi-core, come-on!
// Configure the output anti-aliasing, resolution, etc
"-dAlignToPixels=0",
"-dGridFitTT=0",
"-dTextAlphaBits=4",
"-dGraphicsAlphaBits=4"
};
- 나는 크기 사이의 균형을 Ghostsharp과 그 설정에 익숙하지 않다 품질. 가능한 경우 축소 이미지를 얻는 것이 더 좋지만 축소판에 대해 더 큰 이미지를 만들고 크기를 조정하는 것에 반대하지 않을 것입니다.