using Pdf4meClient;
// You can provide a generated token to initialise authorization.
Pdf4meClient.Pdf4me.Instance.Init(token);
// optimization for maximal memory size reduction (profile: max)
byte[] optimizedPdf = await Pdf4meClient.Pdf4me.Instance.
OptimizeClient.OptimizeByProfileAsync(OptimizeActionProfile.Max,File.ReadAllBytes("PDF_to_Optimise.pdf"));
// and writing the optimized PDF to disk
File.WriteAllBytes("Optimized.pdf", optimizedPdf);