How shall I resolve the warning of Merging of Pdfs?

10 vues (au cours des 30 derniers jours)
Montina
Montina le 5 Avr 2023
Commenté : MarKf le 6 Avr 2023
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

Réponse acceptée

MarKf
MarKf le 5 Avr 2023
Modifié(e) : MarKf le 5 Avr 2023
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 commentaires
MarKf
MarKf le 6 Avr 2023
Modifié(e) : MarKf le 6 Avr 2023
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 le 6 Avr 2023
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.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange

Tags

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by