Collectives on Stack Overflow. Learn more. Asked 8 years, 4 months ago. Active 2 years ago. Viewed 32k times. I have a sub in vb. CreateFont Directory. CP, BaseFont. GetInstance document, fs document. AddTitle "test" document. GetInstance Current. ScaleAbsolute 75, 52 png. SetAbsolutePosition 40, cb. AddImage png cb. EndText document. Close writer. Close fs. SetFontAndSize font, Size cb. Add a comment. The My. SpecialDirectories object allows you to access special directories, such as the MyDocuments directory.
Use the My. MyDocuments property to supply the path. This code rethrows all the exceptions that may occur when writing text to the file.
You can reduce the likelihood of exceptions by using Windows Forms controls such as the OpenFileDialog and the SaveFileDialog components that limit the user choices to valid file names. Using these controls is not foolproof, however. The file system can change between the time the user selects a file and the time that the code executes.
Exception handling is therefore nearly always necessary when with working with files. If you are running in a partial-trust context, the code might throw an exception due to insufficient privileges. Posted Oct am basurajkumbhar. Add your solution here. OK Paste as. Treat my content as plain text, not as HTML.
Existing Members Sign in to your account. This email is in use. Do you need your password? Submit your solution! When answering a question please: Read the question carefully. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid. Related Questions. Create a PDF file programmatically. Net using itextsharp. NET using itextsharp.
HOW to copy pdf file in vb. Generate pdf from excel file. Layout: fixed fluid. Web02 2. Strip HTML. Encode HTML. Paste as-is.
0コメント