We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Convert the PDF Document to Specified Images

I used your c# example and wrote the PDF to a jpg file. The problem is that the PDF form has Text Fields which are filled in before I use the converter.DoConvert() procedure but the jpg file always has blank Text fields.

Why doesn't it include the information in the Text fields?


This message was posted using Page2Forum from Convert the PDF Document to Specified Images - Aspose.Pdf.Kit for .NET

Hi LeRoy,

Please share the input PDF file along with your code snippet, so we could test the issue at our end. You’ll be updated with the results accordingly.

We’re sorry for the inconvenience.
Regards,

Below is the code I've developed to write the pdf to a bmp. I first read the table on line 2, the originjal pdf is on line 28. Lines 19 through 34 populate the text fields. At line 38, I'm doing a convert.bindpdf on the same pdf file and not on the one that has the filled in fields. I believe the problem is that I don't know where the pdf with the filled in fields is located so I can do a converter.bindpdf at line 38. Line 40 is correct because I can open the bmp file and see the blank fields.

I hope I've correctly described the situation and I would appreciate any assistance you can offer.

1. SqlConnection conn = new SqlConnection((string)Session["DBConnectionString"]);<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

2. SqlCommand cmd = new SqlCommand ("Select * from TempContracts where TempContractID=" + Session["NewContractRowID"],conn);

3. conn.Open();

4. SqlDataReader reader = cmd.ExecuteReader();

5. if (reader.Read())

6. {

7. sBusinessId = (PackerID); // ConvertDB(reader["PIN"]);

8. sPIN=ConvertDB(reader["PIN"]);

9. sContactFirstName = ConvertDB(reader["ContactFirstName"]);

10. sContactLastName = ConvertDB(reader["ContactLastName"]);

11. sContactTitle = ConvertDB(reader["ContactTitle"]);

12. sSubmissionDate=ConvertDB(reader["SubmissionDate"]);

13. sPhoneNumber=ConvertDB(reader["PhoneNumber"]);

14. }

15. FDFACXLib.FdfApp FDFAcX = new FDFACXLib.FdfApp();

16. FDFACXLib.FdfDoc objFDF = (FDFACXLib.FdfDoc)FDFAcX.FDFCreate();

17. Uri baseuri = new Uri(BaseURILink);

18. Uri myUri = new Uri(baseuri, "MediaLibrary/OptionalCover102510.pdf");

19. objFDF.FDFSetFile(myUri.AbsoluteUri); objFDF.FDFSetValue("b12c96nfFirmName", PackerName, false);

20. objFDF.FDFSetValue("BusinessId", PackerID, false);

21. objFDF.FDFSetValue("b12c96nfContactFirstName", sContactFirstName, false);

22. objFDF.FDFSetValue("b12c96nfContactLastName", sContactLastName, false);

23. objFDF.FDFSetValue("b12c96nfTitle", sContactTitle, false);

24. objFDF.FDFSetValue("b12c96nfPIN", sPIN, false);

25. objFDF.FDFSetValue("b12c96nfPlantName", ((String)Session["sesPlantName1"]),false);

26. objFDF.FDFSetValue("b12c96nfPlantCity", ((String)Session["sesLocation1"]),false);

27. objFDF.FDFSetValue("b12c96nfPlantCity", ((String)Session["sesLocation1"]), false);

28. objFDF.FDFSetValue("b12c96nfDateOfSubmit", sSubmissionDate, false);

29. objFDF.FDFSetValue("b12c96nfDateEffective", sSubmissionDate, false);

30. objFDF.FDFSetValue("b12c96nfCertifierFirstName", sContactFirstName, false);

31. objFDF.FDFSetValue("b12c96nfCertifierLastName", sContactLastName, false);

32. objFDF.FDFSetValue("b12c96nfCertifierTitle", sContactTitle, false);

33. objFDF.FDFSetValue("b12c96nfPhoneNumber", sPhoneNumber, false);

34. objFDF.FDFSetValue("b12c96nfExistingContractID", sContactTitle, false);

35. Response.ContentType = "application/vnd.fdf";

36. Response.BinaryWrite((byte[])objFDF.FDFSaveToBuf());

37. PdfConverter converter = new PdfConverter();

38. converter.BindPdf(@"C:\Inetpub\wwwroot\Swine\MediaLibrary\OptionalCover102510.pdf");

39. converter.DoConvert();

40. String prefix = @"C:\Temp\";

41. String suffix = ".bmp";

42. int imageCount = 1;

43. while (converter.HasNextImage())

44. {

45. converter.GetNextImage(prefix + imageCount + suffix);

46. imageCount++;

47. }

48. objFDF.FDFClose();

49. Response.End();

50. reader.Close();

51. conn.Close();

Hi LeRoy,

You didn’t share the input PDF file with us. I’m afraid, we’re unable to test the issue with out the problematic PDF file. Please share the PDF file after filling the data in the fields. We’ll test the PDF to Image conversion at our end and update you with the results. I would also like to share that it is very important for our team to reproduce the issue using your particular scenario.

We’re sorry for the inconvenience and looking forward to help you out.
Regards,