Skip to content

Commit

Permalink
[Fix] 코멘트 덧씌워지는 현상 삭제
Browse files Browse the repository at this point in the history
[Fix] 코멘트 덧씌워지는 현상 삭제
  • Loading branch information
wltnryu authored Nov 11, 2024
2 parents e89f543 + 053c658 commit af312b9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ extension CommentViewModel {

// 저장할 comment의 position 값 세팅
func setCommentPosition(selectedComments: [Comment], pdfView: PDFView) {
print("위치값 세팅 시작")
let buttonId = selectedComments.first?.buttonId
let commentId = selectedComments.first?.id

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,18 @@ extension MainPDFViewModel {
print("PDF URL을 찾을 수 없습니다.")
return
}


for pageIndex in 0..<document.pageCount {
guard let page = document.page(at: pageIndex) else { continue }

// 각 페이지의 모든 주석을 반복하며 밑줄과 코멘트 아이콘 지우기
for annotation in page.annotations {
if annotation.value(forAnnotationKey: .contents) != nil {
page.removeAnnotation(annotation)
}
}
}

// PDF 파일을 지정한 URL에 덮어쓰기 저장
do {
let pdfData = document.dataRepresentation()
Expand Down

0 comments on commit af312b9

Please sign in to comment.