PowerShell iTextSharp unethicalreading

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Dave Wyatt Dave Wyatt 3 months, 1 week ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #44830
    Profile photo of Paul Fallows
    Paul Fallows
    Participant

    Hi

    I have a PowerShell script that converts pdf together based on the file name. A number of these have failed due to the following error:

    PdfReader not opened with owner password

    I have seen posts relating to c# scripts which suggest setting unethicalreading to True. I have also seen post relating to legal issues doing this – is it ok to do this? If so, how can you do this in PowerShell? C# can be done using:

    iTextSharp.text.pdf.PdfReader.unethicalreading

    but I can find unethicalreading using PowerShell.

    Many thanks
    Paul

    #44836
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator

    In PowerShell it would look like this:

    [iTextSharp.text.pdf.PdfReader]::unethicalreading = $true
    
    #44838
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator

    As for legal issues, no idea, but if they really wanted to password-protect a PDF file, it would be encrypted, and that "unethicalreading" option wouldn't exist.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.