How shall I resolve the warning of Merging of Pdfs?
4 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
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
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
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 Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!