Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#3.0
Hello,
 
I have a variable that contains a name that I recover the database. and I want my pdf file is created with the name that is in my variable.
 
how I put the variable name in the file path ?
knowing that I program with c #.
 

string name;
 
try
          {
              PdfWriter wri = PdfWriter.GetInstance(doc, new FileStream("c:/Users/User/Desktop/Application/"pdf_name".pdf", FileMode.Create));
 
              doc.Open();
 
thanks
Posted 25-Sep-12 23:18pm
Comments
Andrei Straut at 26-Sep-12 5:34am
   
Try:
PdfWriter wri = PdfWriter.GetInstance(doc, new FileStream("c:/Users/User/Desktop/Application/" + pdf_name + ".pdf", FileMode.Create));
Sushil Mate at 26-Sep-12 5:35am
   
what's the problem?
Member 9410354 at 26-Sep-12 6:09am
   
thanks
I tried it but it does nothing
Member 9410354 at 26-Sep-12 6:14am
   
is solved!
thank you all

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Try Following use + before and after
pdf_name
 
<pre lang="cs">try
          {
              PdfWriter wri = PdfWriter.GetInstance(doc, new FileStream(&quot;c:/Users/User/Desktop/Application/&quot;+pdf_name+&quot;.pdf&quot;, FileMode.Create));
 
              doc.Open();</pre>
  Permalink  
Comments
Member 9410354 at 26-Sep-12 6:14am
   
is solved!
thank you all

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

  Print Answers RSS
0 OriginalGriff 445
1 CHill60 410
2 Sergey Alexandrovich Kryukov 354
3 BillWoodruff 190
4 PIEBALDconsult 160


Advertise | Privacy | Mobile
Web02 | 2.8.141015.1 | Last Updated 26 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100