private static void runSample(string path, Type sample) { Console.WriteLine("GeneratePdf({0});", sample.FullName); var report = SamplesList.GeneratePdf(sample); if (report == null) { return; } if (!File.Exists(report.FileName)) { return; } if (sample == typeof(DigitalSignaturePdfReport)) { return; } var imageData = new PdfToImage { PdfFilePath = report.FileName }.PdfPageToPng(); File.WriteAllBytes(Path.Combine(path, sample.FullName.Replace("PdfReportSamples.", string.Empty) + ".png"), imageData); }
private static void Main() { //Save first page as thumbnail PdfToImage.SaveThumbnail("output\\xray_user_manual.pdf", "output\\", "gsdll\\"); //Save the entire document PdfToImage.SaveImage("output\\xray_user_manual.pdf", "output\\", "gsdll\\"); }
//private List<Texture2D> pdfPages = new List<Texture2D> (); //C:\Users\shubh\Documents\Unity_Projects\OpenCVTest\Assets\StreamingAssets\cert.pdf public void InitialisePdf(InputField path) { //pdfPages.Clear (); totalPageCnt = 0; //Debug.Log(path.text); pti = new PdfToImage(); PdfToImage.logs += PdfLog; // Debug.Log (pti.Test()); if (pti.ReadPdf(path.text, ref totalPageCnt)) { logTxt.text = "Page: (" + (currPageIndex + 1).ToString() + "/" + totalPageCnt.ToString() + ")"; } else { logTxt.text = "unable to read"; } pdfSceneImg.texture = pti.GetDrawImageFromPdf(0); //pdfSceneImg.texture = pdfPages [0]; }
/// <summary> /// Open the Convert PDF Form /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnOpenPdfForm_Click(object sender, EventArgs e) { var NewForm = new PdfToImage(); NewForm.Show(); }