You must Sign In to post a response.
  • Category: ASP.NET

    Base64 Encypted File Convert Into PDF File Without asking password

    I have Encrypted PDF File and i have convert encypted PDF file To Base64 string. I want Base64 string convert into PDF File (Means PDF file will write without password). PDF File should open.

    Base64 string is perfectly convert into pdf file but when i am trying to open the pdf file it is asking password. i

    I want when file is convert into Encryted base64 to PDF File then it shold open with password .
    File is saving on my folder.

    How i can do it. with asp.net with c#.

    public static string AlldocToPDF(AlldocToPDFInput objAlldocToPDFInput, string DirvePath)
    {
    Byte[] Xlsbytes;
    List<iTextSharp.text.Document> objDocs = new List<iTextSharp.text.Document>();
    List<string> fNames = new List<string>();

    try
    {
    foreach (var x in objAlldocToPDFInput.Documents)
    {
    string Filepathname = DirvePath + DateTime.Now.ToString("yyyyMMddHHmmssfff") + ".pdf";
    string str = x.FileContent.ToString();
    Xlsbytes = Convert.FromBase64String(str);

    if (x.FileExtension == "pdf")
    {
    File.WriteAllBytes(Filepathname, Xlsbytes);
    }
    else
    {
    iTextSharp.text.Image image = iTextSharp.text.Image.GetInstance(Xlsbytes);
    iTextSharp.text.Rectangle pageSize = null;
    pageSize = new iTextSharp.text.Rectangle(0, 0, image.Width, image.Height);
    using (var ms = new MemoryStream())
    {
    var document = new iTextSharp.text.Document(pageSize, 0, 0, 0, 0);
    iTextSharp.text.pdf.PdfWriter.GetInstance(document, ms).SetFullCompression();
    document.Open();
    document.Add(image);
    document.Close();
    objDocs.Add(document);
    File.WriteAllBytes(Filepathname, ms.ToArray());
    }
    }
    fNames.Add(Filepathname);

    }
    string outFile = DirvePath + DateTime.Now.ToString("yyyyMMddHHmmssfff") + ".pdf";
    CombineMultiplePDFs(fNames, outFile);
    Xlsbytes = File.ReadAllBytes(outFile);
    fNames.Add(outFile);
    string Base64string = Convert.ToBase64String(Xlsbytes);
    return Base64string;
    }
    catch (Exception ex)
    {
    return "False";
    }
    finally
    {
    if (fNames.Count > 1)
    {
    foreach (string fname in fNames)
    {
    if (File.Exists(fname))
    {
    File.Delete(fname);
    }
    }
    }
    }
    }
  • #769599
    The base of the part which can be the most encrypted file need to convert into the pdf file without asking the password so for that you need to know the process and if you are not able to get then take the help from https://printerchatsupport.co.uk/dell-printer-support/ for the support which you all needed.

  • #769600
    The base of the part which can be the most encrypted file need to convert into the pdf file without asking the password so for that you need to know the process and if you are not able to get then take the help from <a href="https://printerchatsupport.co.uk/dell-printer-support/">Dell Printer Support</a> for the support which you all need.


  • Sign In to post your comments