약 1000 개의 pdf 파일이 있으며 300 dpi tiff 파일로 변환해야합니다. 가장 좋은 방법은 무엇입니까? SDK 또는 수용 할 수있는 도구 또는 도구가있는 경우 이상적입니다.
Imagemagick 또는 Ghostscript를 사용하십시오.
http://www.ibm.com/developerworks/library/l-graf2/#N101C2 에는 imagemagick의 예가 있습니다.
convert foo.pdf pages-%03d.tiff
http://www.asmail.be/msg0055376363.html 고스트 스크립트에 대한 예가 있습니다.
gs -q -dNOPAUSE -sDEVICE=tiffg4 -sOutputFile=a.tif foo.pdf -c quit
고스트 스크립트를 설치하고 gs 매뉴얼 페이지를 읽고 정확한 옵션이 무엇인지 확인하고 실험 해보십시오.
커맨드 라인에서 GhostScript를 사용하여 과거에 다음을 사용했습니다.
windows에서 :
gswin32c -dNOPAUSE -q -g300x300 -sDEVICE=tiffg4 -dBATCH -sOutputFile=output_file_name.tif input_file_name.pdf
* nix에서 :
gs -dNOPAUSE -q -g300x300 -sDEVICE=tiffg4 -dBATCH -sOutputFile=output_file_name.tif input_file_name.pdf
많은 파일의 경우 간단한 배치/쉘 스크립트를 사용하여 임의의 수의 파일을 변환 할 수 있습니다 ...
디렉토리 구조를 통해 고스트 스크립트를 사용하여 모든 pdf 파일을 tiff 파일로 변환하는 작은 powershell 스크립트를 작성했습니다. 내 스크립트는 다음과 같습니다.
$tool = 'C:\Program Files\gs\gs8.63\bin\gswin32c.exe'
$pdfs = get-childitem . -recurse | where {$_.Extension -match "pdf"}
foreach($pdf in $pdfs)
{
$tiff = $pdf.FullName.split('.')[0] + '.tiff'
if(test-path $tiff)
{
"tiff file already exists " + $tiff
}
else
{
'Processing ' + $pdf.Name
$param = "-sOutputFile=$tiff"
& $tool -q -dNOPAUSE -sDEVICE=tiffg4 $param -r300 $pdf.FullName -c quit
}
}
1) GhostScript 설치
2) ImageMagick 설치
3) "TIFF.bat로 변환"(Windows XP, Vista, 7)을 작성하고 다음 행을 사용하십시오.
for %%f in (%*) DO "C:\Program Files\ImageMagick-6.6.4-Q16\convert.exe" -density 300 -compress lzw %%f %%f.tiff
여러 페이지의 단일 페이지 PDF) 파일을이 파일로 드래그하면 300 DPI에서 압축 TIFF로 변환됩니다.
python 사용하여 이것은 결국
import os
os.popen(' '.join([
self._ghostscriptPath + 'gswin32c.exe',
'-q',
'-dNOPAUSE',
'-dBATCH',
'-r300',
'-sDEVICE=tiff12nc',
'-sPAPERSIZE=a4',
'-sOutputFile=%s %s' % (tifDest, pdfSource),
]))
PDF Focus .Net은 다음과 같은 방법으로이를 수행 할 수 있습니다.
1.PDF to TIFF
SautinSoft.PdfFocus f = new SautinSoft.PdfFocus();
string pdfPath = @"c:\My.pdf";
string imageFolder = @"c:\images\";
f.OpenPdf(pdfPath);
if (f.PageCount > 0)
{
//Save all PDF pages to image folder as tiff images, 200 dpi
int result = f.ToImage(imageFolder, "page",System.Drawing.Imaging.ImageFormat.Tiff, 200);
}
2.PDF to Multipage-TIFF
//Convert PDF file to Multipage TIFF file
SautinSoft.PdfFocus f = new SautinSoft.PdfFocus();
string pdfPath = @"c:\Document.pdf";
string tiffPath = @"c:\Result.tiff";
f.OpenPdf(pdfPath);
if (f.PageCount > 0)
{
f.ToMultipageTiff(tiffPath, 120) == 0)
{
System.Diagnostics.Process.Start(tiffPath);
}
}
ABCPDF도 가능합니다- http://www.websupergoo.com/helppdf6net/default.html
우분투에서 테스트 한 필수 고스트 스크립트 및 tiffcp
import os
def pdf2tiff(source, destination):
idx = destination.rindex('.')
destination = destination[:idx]
args = [
'-q', '-dNOPAUSE', '-dBATCH',
'-sDEVICE=tiffg4',
'-r600', '-sPAPERSIZE=a4',
'-sOutputFile=' + destination + '__%03d.tiff'
]
gs_cmd = 'gs ' + ' '.join(args) +' '+ source
os.system(gs_cmd)
args = [destination + '__*.tiff', destination + '.tiff' ]
tiffcp_cmd = 'tiffcp ' + ' '.join(args)
os.system(tiffcp_cmd)
args = [destination + '__*.tiff']
rm_cmd = 'rm ' + ' '.join(args)
os.system(rm_cmd)
pdf2tiff('abc.pdf', 'abc.tiff')
Pdf2tiff는 어떻습니까? http://python.net/~gherman/pdf2tiff.html
어쩌면 이것도 시도해? PDF 포커스
이 .Net 라이브러리를 사용하면 문제를 해결할 수 있습니다. :)
이 코드는 도움이 될 것입니다 (1000 PDF 파일을 C #에서 300dpi TIFF 파일로 변환)).
SautinSoft.PdfFocus f = new SautinSoft.PdfFocus();
string[] pdfFiles = Directory.GetFiles(@"d:\Folder with 1000 pdfs\", "*.pdf");
string folderWithTiffs = @"d:\Folder with TIFFs\";
foreach (string pdffile in pdfFiles)
{
f.OpenPdf(pdffile);
if (f.PageCount > 0)
{
//save all pages to tiff files with 300 dpi
f.ToImage(folderWithTiffs, Path.GetFileNameWithoutExtension(pdffile), System.Drawing.Imaging.ImageFormat.Tiff, 300);
}
f.ClosePdf();
}
https://pypi.org/project/pdf2tiff/
Pdf2ps, ps2image를 사용하고 다른 유틸리티를 사용하여 결과 이미지에서 tiff로 변환 할 수도 있습니다 ( 'paul'[paul-다른 이미지 뷰어 (PNG, TIFF, GIF, JPG 등 표시)]
면책 조항 : 내가 추천하는 제품에 대한 작업
Atalasoft는 .NET 라이브러리를 가지고 있으며 convert PDF to TIFF -FOXIT의 파트너이므로 PDF 렌더링 아주 좋습니다.
PDFTIFF.com을 convert PDF에서 TIFF로) 에 좋아합니다. 무제한 페이지를 처리 할 수 있습니다