[ https://issues.apache.org/jira/browse/PDFBOX-5854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17869731#comment-17869731 ]
menteith edited comment on PDFBOX-5854 at 7/30/24 7:02 PM: ----------------------------------------------------------- No particular reason. Why PDFBox allows for removing ID yet it doesn't do it? Is there any way to get rid of it? The pdf I have is in copyright. I could send it to a personal email but I don't feel comfortable sharing it to anyone. EDIT: Changing ID doesn't seem to work either: {{final COSArray cosArray = new COSArray();}} {{cosArray.add(new COSString("nope"));}} {{document.getDocument().setDocumentID(cosArray);}} was (Author: JIRAUSER298800): No particular reason. Why PDFBox allows for removing ID yet it doesn't do it? Is there any way to get rid of it? The pdf I have is in copyright. I could send it to a personal email but I don't feel comfortable sharing it to anyone. EDIT: Changing ID doesn't seem to work either: {{final COSArray cosArray = new COSArray();}} {{cosArray.add(new COSString("kicia"));}} {{document.getDocument().setDocumentID(cosArray);}} > PDFBox is unable to remove ID > ----------------------------- > > Key: PDFBOX-5854 > URL: https://issues.apache.org/jira/browse/PDFBOX-5854 > Project: PDFBox > Issue Type: Bug > Components: Writing > Affects Versions: 3.0.2 PDFBox > Reporter: menteith > Priority: Minor > > I tried to remove ID from a PDF file using PDFBox. Any of my attemps haven't > resulted in ID being removed. Please have a look how I tried to do so: > {{if ( document.getDocument().getDocumentID() != null ) {}} > {{// 1. doesn't work}} > {{document.getDocument().setDocumentID(null);}} > {{//2. doesn't work either}} > {{document.getDocument().getTrailer().removeItem(COSName.ID);}} > {{// 3. doesn't work}} > {{final COSDictionary newTrailer = document.getDocument().getTrailer();}} > {{newTrailer.removeItem(COSName.ENCRYPT);}} > {{newTrailer.removeItem(COSName.ID);}} > {{document.getDocument().setTrailer(newTrailer);}} > {{// 4. doesn't work}} > {{final COSArray documentID = document.getDocument().getDocumentID();}} > {{documentID.clear();}} > {{document.getDocument().setDocumentID(documentID);}} > {{}}} > Who I can send a source PDF to? -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org