DeveloperAcademy-POSTECH / MacC-Afternoon-Team11-FoursTech-Blank

https://apps.apple.com/kr/app/id6471817064?l=ko
0 stars 0 forks source link

[Feat] 이미지 여백 늘리기 기능 #121

Closed ayaysir closed 10 months ago

ayaysir commented 10 months ago

개요 및 관련 이슈

117

작업 사항

주요 로직(Optional)

    func generateCurrentImage() {
        guard let page = pdfDocument.page(at: currentPage - 1) else {
            return
        }

        // TODO: - 더 큰 해상도도 정확히 인식할 수 있어야 함
        // 현재 가로 해상도 최대 600을 넘어가면 범위 어긋남
        let maxWidth: CGFloat = 620 // 최대 크기를 더 늘릴 수 있다면 늘려보기
        let maxHeight: CGFloat = maxWidth * 1.414

예제 파일들의 width 수치

samplepdf.pdf
pageRect.size (612.0, 864.0)
height = width * 1.4117647059

toeic.pdf
pageRect.size (595.32, 841.9200000000001)
height = width * 1.4142310018

elementarySchool.pdf
pageRect.size (595.5, 842.25)
height = width * 1.4143576826

sample.pdf
pageRect.size (595.2756, 841.8898)
height = 1.414

A4
height = width * 1.4142857143