how to save pdf file in folder without save dialog c# windows applicationHow do I get the path of the assembly the code is in?How to create Excel (.XLS and .XLSX) file in C# without installing Ms Office?How do I save a stream to a file in C#?How to save application settings in a Windows Forms Application?Creating pdf files at runtime in c#How do I get a consistent byte representation of strings in C# without manually specifying an encoding?How to delete all files and folders in a directory?c# open file with default application and parametersLink to open a PDF file that's saved in a folder?How to save a pdf as an object in c#
What is a precise issue with allowing getters?
Should I simplify my writing in a foreign country?
Where are the "shires" in the UK?
Is disk brake effectiveness mitigated by tyres losing traction under strong braking?
Can the Tidal Wave spell trigger a vampire's weakness to running water?
Looking for sci-fi book based on Hinduism/Buddhism
Hostile Divisor Numbers
Would a "Permanence" spell in 5e be overpowered?
Counting the Number of Real Roots of A Polynomial
How to preserve a rare version of a book?
Why is my arithmetic with a long long int behaving this way?
Switch Function Not working Properly
How to pass hash as password to ssh server
Is the book wrong about the Nyquist Sampling Criterion?
As black, how should one respond to 4. Qe2 by white in the Russian Game, Damiano Variation?
Copy previous line to current line from text file
Madam I m Adam..please don’t get mad..you will no longer be prime
Drawing an hexagonal cone in TikZ 2D
Clarification of algebra in moment generating functions
Who filmed the Apollo 11 trans-lunar injection?
Why is "breaking the mould" positively connoted?
Is there a word for food that's gone 'bad', but is still edible?
If an old FIN is delivered, will TCP terminate the new connection?
In linear regression why does regularisation penalise the parameter values as well?
how to save pdf file in folder without save dialog c# windows application
How do I get the path of the assembly the code is in?How to create Excel (.XLS and .XLSX) file in C# without installing Ms Office?How do I save a stream to a file in C#?How to save application settings in a Windows Forms Application?Creating pdf files at runtime in c#How do I get a consistent byte representation of strings in C# without manually specifying an encoding?How to delete all files and folders in a directory?c# open file with default application and parametersLink to open a PDF file that's saved in a folder?How to save a pdf as an object in c#
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
This is my code for opening a PDF file. I need this file to be saved to a certain location in my computer eg.: @"c:temp"
List<string> pdfFiles = new List<string>();
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.CheckFileExists = true;
openFileDialog.AddExtension = true;
openFileDialog.Multiselect = true;
openFileDialog.Filter = "PDF files (*.pdf)|*.pdf";
if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
pdfFiles = new List<string>();
foreach (string fileName in openFileDialog.FileNames)
pdfFiles.Add(fileName);
c#
add a comment |
This is my code for opening a PDF file. I need this file to be saved to a certain location in my computer eg.: @"c:temp"
List<string> pdfFiles = new List<string>();
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.CheckFileExists = true;
openFileDialog.AddExtension = true;
openFileDialog.Multiselect = true;
openFileDialog.Filter = "PDF files (*.pdf)|*.pdf";
if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
pdfFiles = new List<string>();
foreach (string fileName in openFileDialog.FileNames)
pdfFiles.Add(fileName);
c#
But you never open any files. Do you just want to copy the files?
– FalcoGer
Mar 23 at 11:02
add a comment |
This is my code for opening a PDF file. I need this file to be saved to a certain location in my computer eg.: @"c:temp"
List<string> pdfFiles = new List<string>();
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.CheckFileExists = true;
openFileDialog.AddExtension = true;
openFileDialog.Multiselect = true;
openFileDialog.Filter = "PDF files (*.pdf)|*.pdf";
if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
pdfFiles = new List<string>();
foreach (string fileName in openFileDialog.FileNames)
pdfFiles.Add(fileName);
c#
This is my code for opening a PDF file. I need this file to be saved to a certain location in my computer eg.: @"c:temp"
List<string> pdfFiles = new List<string>();
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.CheckFileExists = true;
openFileDialog.AddExtension = true;
openFileDialog.Multiselect = true;
openFileDialog.Filter = "PDF files (*.pdf)|*.pdf";
if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
pdfFiles = new List<string>();
foreach (string fileName in openFileDialog.FileNames)
pdfFiles.Add(fileName);
c#
c#
edited Mar 23 at 10:15
Ameen
8151821
8151821
asked Mar 23 at 3:12
Roshan AbrewRoshan Abrew
41
41
But you never open any files. Do you just want to copy the files?
– FalcoGer
Mar 23 at 11:02
add a comment |
But you never open any files. Do you just want to copy the files?
– FalcoGer
Mar 23 at 11:02
But you never open any files. Do you just want to copy the files?
– FalcoGer
Mar 23 at 11:02
But you never open any files. Do you just want to copy the files?
– FalcoGer
Mar 23 at 11:02
add a comment |
2 Answers
2
active
oldest
votes
You can use the File.Copy
method to copy the file to its new location.
First, obtain the path of the file in the old location and desired new location.
Then, apply this method.
File.Copy(@"C:old.txt", @"C:new.txt");
Thanks, now it is working
– Roshan Abrew
Mar 27 at 10:23
add a comment |
try this
add this Reference file - iTextSharp.text.pdf
string Folderpath ="your path";
using (FileStream stream = new FileStream(Folderpath, FileMode.Create))
Document pdfDoc = new Document(PageSize.A2, 10f, 10f, 10f, 0f);
PdfWriter.GetInstance(pdfDoc, stream);
pdfDoc.Open();
// Paragraph k = new Paragraph("Your PDF ");
// pdfDoc.Add(k);
pdfDoc.Close();
stream.Close();
Thanks bro, i got idea from your code...
– Roshan Abrew
Mar 27 at 10:23
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55310255%2fhow-to-save-pdf-file-in-folder-without-save-dialog-c-sharp-windows-application%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can use the File.Copy
method to copy the file to its new location.
First, obtain the path of the file in the old location and desired new location.
Then, apply this method.
File.Copy(@"C:old.txt", @"C:new.txt");
Thanks, now it is working
– Roshan Abrew
Mar 27 at 10:23
add a comment |
You can use the File.Copy
method to copy the file to its new location.
First, obtain the path of the file in the old location and desired new location.
Then, apply this method.
File.Copy(@"C:old.txt", @"C:new.txt");
Thanks, now it is working
– Roshan Abrew
Mar 27 at 10:23
add a comment |
You can use the File.Copy
method to copy the file to its new location.
First, obtain the path of the file in the old location and desired new location.
Then, apply this method.
File.Copy(@"C:old.txt", @"C:new.txt");
You can use the File.Copy
method to copy the file to its new location.
First, obtain the path of the file in the old location and desired new location.
Then, apply this method.
File.Copy(@"C:old.txt", @"C:new.txt");
edited Mar 23 at 4:10
Andy Ng
191
191
answered Mar 23 at 3:16
Thivanka SaranathaThivanka Saranatha
1627
1627
Thanks, now it is working
– Roshan Abrew
Mar 27 at 10:23
add a comment |
Thanks, now it is working
– Roshan Abrew
Mar 27 at 10:23
Thanks, now it is working
– Roshan Abrew
Mar 27 at 10:23
Thanks, now it is working
– Roshan Abrew
Mar 27 at 10:23
add a comment |
try this
add this Reference file - iTextSharp.text.pdf
string Folderpath ="your path";
using (FileStream stream = new FileStream(Folderpath, FileMode.Create))
Document pdfDoc = new Document(PageSize.A2, 10f, 10f, 10f, 0f);
PdfWriter.GetInstance(pdfDoc, stream);
pdfDoc.Open();
// Paragraph k = new Paragraph("Your PDF ");
// pdfDoc.Add(k);
pdfDoc.Close();
stream.Close();
Thanks bro, i got idea from your code...
– Roshan Abrew
Mar 27 at 10:23
add a comment |
try this
add this Reference file - iTextSharp.text.pdf
string Folderpath ="your path";
using (FileStream stream = new FileStream(Folderpath, FileMode.Create))
Document pdfDoc = new Document(PageSize.A2, 10f, 10f, 10f, 0f);
PdfWriter.GetInstance(pdfDoc, stream);
pdfDoc.Open();
// Paragraph k = new Paragraph("Your PDF ");
// pdfDoc.Add(k);
pdfDoc.Close();
stream.Close();
Thanks bro, i got idea from your code...
– Roshan Abrew
Mar 27 at 10:23
add a comment |
try this
add this Reference file - iTextSharp.text.pdf
string Folderpath ="your path";
using (FileStream stream = new FileStream(Folderpath, FileMode.Create))
Document pdfDoc = new Document(PageSize.A2, 10f, 10f, 10f, 0f);
PdfWriter.GetInstance(pdfDoc, stream);
pdfDoc.Open();
// Paragraph k = new Paragraph("Your PDF ");
// pdfDoc.Add(k);
pdfDoc.Close();
stream.Close();
try this
add this Reference file - iTextSharp.text.pdf
string Folderpath ="your path";
using (FileStream stream = new FileStream(Folderpath, FileMode.Create))
Document pdfDoc = new Document(PageSize.A2, 10f, 10f, 10f, 0f);
PdfWriter.GetInstance(pdfDoc, stream);
pdfDoc.Open();
// Paragraph k = new Paragraph("Your PDF ");
// pdfDoc.Add(k);
pdfDoc.Close();
stream.Close();
answered Mar 23 at 5:08
Dhanushka DayawanshaDhanushka Dayawansha
361210
361210
Thanks bro, i got idea from your code...
– Roshan Abrew
Mar 27 at 10:23
add a comment |
Thanks bro, i got idea from your code...
– Roshan Abrew
Mar 27 at 10:23
Thanks bro, i got idea from your code...
– Roshan Abrew
Mar 27 at 10:23
Thanks bro, i got idea from your code...
– Roshan Abrew
Mar 27 at 10:23
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55310255%2fhow-to-save-pdf-file-in-folder-without-save-dialog-c-sharp-windows-application%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
But you never open any files. Do you just want to copy the files?
– FalcoGer
Mar 23 at 11:02