필터 지우기
필터 지우기

How shall I resolve the warning of Merging of Pdfs?

조회 수: 3 (최근 30일)
Montina
Montina 2023년 4월 5일
댓글: MarKf 2023년 4월 6일
I have been trying to merge pdfs. With this function, I am able to merge the pdfs, however , it throws warning. "[WARN] PDFMergerUtility - Removed /IDTree from /Names dictionary, doesn't belong there". Please let me know, the steps to resolve.
MergePdf Link: MergePDF

채택된 답변

MarKf
MarKf 2023년 4월 5일
편집: MarKf 2023년 4월 5일
Nice little utility (and overall apache pdfbox functionality), I just tried it, it worked and it didn't even give me an error (because I don't have IDTrees in the pdfs I guess).
Anyway whenever there is a warning that one needs to suppress (like while in loop for example) you can get the warning identifier and shut it. However that might be more tricky for these internal functions maybe lacking identifiers. Try:
% [mwarn, mwarnid] = lastwarn; %to get id of warning thrown by process
wrn = warning('off',mwarnid); %like 'stats:statrobustfit:IterationLimit' or 'MATLAB:DELETE:FileNotFound'
% code
warning(wrn) %reset previous warning state
  댓글 수: 3
MarKf
MarKf 2023년 4월 6일
편집: MarKf 2023년 4월 6일
Can you get the ID with [mwarn, mwarnid] = lastwarn; after getting 1 instance of the warning? You have to substitute it in the second line of the code above (mwarnid that is) then. Is the warning issued/handled with the warning function (are the warnings in orange)? In that canse you could also just suppress all warnings (with wrn=warning('off') and then reset the previous warning state as above or with warning('on') as well). Otherwise if it is just displayed in an inner-workings way then you'd have to delve deeper, which I'd suggest against if you cannot make the code above work. Also consider accepting the answer if that's what you were looking for or if it helped.
MarKf
MarKf 2023년 4월 6일
I mean it's java stuff... You could try adding merger.setIgnoreAcroFormErrors(true) in the code of MergePDF above. You could also delete the IDtrees of both pdfs since you are likely not interested in keeping them and they are what's causing the issue, using the same utility (pdfbox). I'd say disabling the warnings is your safest bet.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

태그

제품


릴리스

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by