Add Barcode to PDF
-
- Posts: 8
- Joined: Fri Dec 11, 2009 8:28 pm
Add Barcode to PDF
We need to add a barcode to an Existing PDF. We added the following snippet of code but do not see the barcode.
Dim oGdPicturePDF As New GdPicturePDF
gdpicturestatus = oGdPicturePDF.DrawBarcode1D(Barcode1DWriterType.Barcode1DWriterCode39, "Test", 10, 10, 250, 80, Color.Black)
the return status code is Generic Error {1}
Can you tell me what we did wrong or give me an example of how to add the barcode?
Dim oGdPicturePDF As New GdPicturePDF
gdpicturestatus = oGdPicturePDF.DrawBarcode1D(Barcode1DWriterType.Barcode1DWriterCode39, "Test", 10, 10, 250, 80, Color.Black)
the return status code is Generic Error {1}
Can you tell me what we did wrong or give me an example of how to add the barcode?
Re: Add Barcode to PDF
Hi,
Here a snippet:
Let me know if you need further information.
Kind regards,
Loïc
Here a snippet:
Code: Select all
Dim oGdPicturePDF As New GdPicturePDF
oGdPicturePDF.LoadFromFile("c:\test.pdf", False)
oGdPicturePDF.SelectPage(1)
oGdPicturePDF.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitCentimeter)
oGdPicturePDF.SetOrigin(PdfOrigin.PdfOriginTopLeft)
oGdPicturePDF.DrawBarcode1D(Barcode1DWriterType.Barcode1DWriterCode128, "0123456789", 1, 1, 5, 1, Color.Red)
oGdPicturePDF.SaveToFile("c:\test2.pdf")
Let me know if you need further information.
Kind regards,
Loïc
Re: Add Barcode to PDF
"Dim oGdPicturePDF As New GdPicturePDF
oGdPicturePDF.LoadFromFile("c:\test.pdf", False)
oGdPicturePDF.SelectPage(1)
oGdPicturePDF.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitCentimeter)
oGdPicturePDF.SetOrigin(PdfOrigin.PdfOriginTopLeft)
oGdPicturePDF.DrawBarcode1D(Barcode1DWriterType.Barcode1DWriterCode128, "0123456789", 1, 1, 5, 1, Color.Red)
oGdPicturePDF.SaveToFile("c:\test2.pdf")"
why does this code gave me a message on the created file "There was an error opening this document. The file is damaged and could not be repaired."
oGdPicturePDF.LoadFromFile("c:\test.pdf", False)
oGdPicturePDF.SelectPage(1)
oGdPicturePDF.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitCentimeter)
oGdPicturePDF.SetOrigin(PdfOrigin.PdfOriginTopLeft)
oGdPicturePDF.DrawBarcode1D(Barcode1DWriterType.Barcode1DWriterCode128, "0123456789", 1, 1, 5, 1, Color.Red)
oGdPicturePDF.SaveToFile("c:\test2.pdf")"
why does this code gave me a message on the created file "There was an error opening this document. The file is damaged and could not be repaired."
Re: Add Barcode to PDF
Hello,
Your code is working like a charm from my end.
Could you tell us the version of GdPicture you are using and if you've experienced the problem with any pdf document?
Kind regards,
Loïc
Your code is working like a charm from my end.
Could you tell us the version of GdPicture you are using and if you've experienced the problem with any pdf document?
Kind regards,
Loïc
Re: Add Barcode to PDF
Thank you Loic, the codes works fine, my pc just need to be rebooted because I'm using it for almost 1 and a half day.
Re: Add Barcode to PDF
ok thank you for the return
Re: Add Barcode to PDF
Here you can find updated code snippet based on GdPicture.NET 14:
Drawing 1D barcode via mouse on your document
https://www.gdpicture.com/guides/gdpicture/web ... ment.html
Drawing 1D barcode via mouse on your document
https://www.gdpicture.com/guides/gdpicture/web ... ment.html
Who is online
Users browsing this forum: No registered users and 1 guest