형식이 .png 인 .pdf 파일을 변환해야하는 한 가지 문제가 있습니다. 해결책을 제안하십시오. iphone에서 .png 이미지를 .pdf로 프로그램 방식으로 변환하는 방법
은 아래 URL에서 코드를 얻을 수 마단 모한
5
A
답변
3
을 주셔서 감사합니다. 응용 프로그램이 제대로 작동 정말 ........ 그 통해
http://ipdfdev.com/2011/04/22/convert-an-image-to-pdf-on-the-iphone-and-ipad/
1
을 이동하지만 난 pdf 파일 및 디스플레이의 UIWebView에이 .tif 파일을 변환해야합니다.
+0
ANURAG 알려주십시오. 어떤 해결책이 있으면 알려주십시오. – Mangesh
-2
-(void)createPdf:(NSImage*)image
{
PDFDocument *pdf = [[PDFDocument alloc] init];
NSImage *image = [[NSImage alloc] initWithContentsOfFile:fileName];
PDFPage *page = [[PDFPage alloc] initWithImage:image];
[pdf insertPage:page atIndex: [pdf pageCount]];
[pdf writeToFile:path];
}
사용 다음과 같은 위의 방법 :
NSImage *image = [[NSImage alloc] initWithContentsOfFile:PATH_OF_YOUR_PNG_FILE];
[self createPdf:image];
+2
PDFDocument 및 PDFPage 란 무엇입니까? OP는 iPhone 개발에 대해 질문했습니다. –
0
를 사용하여 다음 코드는 이미지에서 PDF 파일을 만들 수 있습니다.
UIImage* image = [UIImage imageNamed:@"sample.png"];
CGRect frame = CGRectMake(20, 100, 300, 60);
NSString* fileName = @"FileName.PDF";
NSArray *arrayPaths =
NSSearchPathForDirectoriesInDomains(
NSDocumentDirectory,
NSUserDomainMask,
YES);
NSString *path = [arrayPaths objectAtIndex:0];
NSString* pdfFileName = [path stringByAppendingPathComponent:fileName];
// Create the PDF context using the default page size of 612 x 792.
UIGraphicsBeginPDFContextToFile(pdfFileName, CGRectZero, nil);
// Mark the beginning of a new page.
UIGraphicsBeginPDFPageWithInfo(CGRectMake(0, 0, 612, 792), nil);
[image drawInRect:frame];
// Close the PDF context and write the contents out.
UIGraphicsEndPDFContext();
관련 문제
- 1. iPhone에서 비디오로 이미지를 변환하는 방법?
- 2. Windows에서 프로그래밍 방식으로 SVG를 PDF로 변환하는 방법?
- 3. PHP를 사용하여 이미지를 pdf로 변환하는 방법?
- 4. iPhone에서 이미지 변환하는 방법?
- 5. HTML을 PDF로 변환하는 방법
- 6. GSWin : XPS를 PDF로 변환하는 방법?
- 7. PNG 이미지를 바이트 배열로 변환하는 방법은 무엇입니까?
- 8. Grails에서 RTF를 PDF로 변환하는 방법?
- 9. html 콘텐츠를 pdf로 변환하는 방법?
- 10. .CATDrawing 파일을 .pdf로 변환하는 방법
- 11. gp4 파일을 pdf로 변환하는 방법
- 12. PHP GD에서 생성 된 이미지를 PDF로 변환하는 방법
- 13. iPhone에서 오디오 파일을 변환하는 방법
- 14. doc 파일을 iphone에서 pdf로 변환
- 15. 이미지를 안드로이드에서 PDF로 변환
- 16. HTML을 PDF로 변환하는 대신?
- 17. PHP를 사용하여 DirectWrite 형식의 이미지를 글꼴 (PNG)로 변환하는 방법?
- 18. 여러 PNG 이미지를 하나의 TIFF 파일로 변환하는 방법
- 19. iPhone에서 이미지를 확대하는 방법?
- 20. IOS에서 프로그래밍 방식으로 PDF를 PNG로 변환하는 방법
- 21. VBScript로 .png 이미지를 수정하는 방법
- 22. C# - 프로그래밍 방식으로 단어를 PDF로
- 23. 이미지를 Redscale로 변환하는 방법?
- 24. iPhone에서 base64 이미지의보기를 변환하는 방법?
- 25. jpg/png 업로드, pdf로 변환, PHP로 저장?
- 26. iPhone에서 텍스트와 이미지를 PDF로 표시하고 만드는 방법은 무엇입니까?
- 27. iOS 내에서 UIView를 PDF로 변환하는 방법?
- 28. MS doc 문서를 pdf로 변환하는 방법
- 29. vb.net을 사용하여 Word 문서를 pdf로 변환하는 방법?
- 30. 프로그래밍없이 InfoPath 웹 양식을 pdf로 변환하는 방법
this-이 http://stackoverflow.com/questions/1360912/how-can-i-create-a-pdf-file-programmatically-in-an-iphone-application 당신이 findout 것입니다 참조하시기 바랍니다! –
.png 파일 하나의 이미지가 있거나 이미지를 pdf로 변환하는 이미지 세트가 있습니까? –