Click here to Skip to main content
15,941,973 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
im new to programming, and i wanted to save some dada icluding data grid view into a pdf file, i tested so many packages. but all of them doesnt support arabic, so i downloaded this: DgvPrinter from github[^]

but i still can not do it silencely into a specific path without displaying the dialog,

What I have tried:

i tried these tools iTextSharp,abcPDF,Spire.
but finally i found this class, which really helped alot. but still unable to print to file using microsoft pdf printer silencely without a dialog.
Updated 29-Jul-22 19:05pm

1 solution

Why are you printing it using a PDF printer at all?

All you need to do is get the underlying data source data (the DataTable you loaded the DGV from via it's DataSource property) and use iTextSharp to convert it to a PDF: Exporting Data From DataTable To PDF[^] shows how to do that.

That way, you aren't "printing" at all, and it needs no print dialog.
Share this answer
Mohamed Hesham Jul2022 30-Jul-22 1:15am    
iTextSharp doesnt support arabic language, that's why i used pdfPrinter.
OriginalGriff 30-Jul-22 1:41am    
It does, but only in some places:
Mohamed Hesham Jul2022 30-Jul-22 2:05am    
no, bro it can only reverse the direction of typing. نعم is printed as ن ع م so its unreadable.
ن +ع +م = نعم those 3 letters are connected togther to form a word.
ن عـم here is 2 letters are connected but the first is not.
نـعـم ==>> the correct without spaces.
نـع م
that's why i used pdfPrinter.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900