IO - Read two image files and put them into one file
Hi,
i have 3 files in all. The two image files and one text file. I need to place the image in the first image file, followed by text in the text file and then the image in the second image file, into one file.
Can anyone tell me how do i go about doing this ?
i tried using fileinputstream and fileoutputstream, which works fine if all the 3 files have text but when the first and the third file have image, the code doesn't give any error but the result file displays only the image from the first file and nothing else.
i am running short of time and need to do this really soon.
if anyone has done anything like this. please let me know,
thanx,
poonam
One approach would be to programmatcally create a single zip/jar file from the three input files. You can use the java.util.zip and java.util.jar packages for this purpose.
The other apprach would be to create a single image by drawing images and text strings on a BufferedImage object.
I think the first approach is preferable because you can easily extract the individual files from the zip/jar file
Similar Messages
-
Hello !
As I said in title , I have alot files (e.g. 60 files) and I want to write a code to copy 5 columns (for examples) of special sheet of files and paste them in one file respectively. For perceive it I explained it more below .
Suppose one of my files is simplified as this : http://s000.tinyupload.com/?file_id=00699705919876414523
The name of this file is 2006Oct and assume my excel files are like "2006Oct, 2006Nov,2006Dec,2007Jan ... 2010Dec". At first I should go to "my files" sheet of 2006Oct file and copy columns " A,B,C,D,E,F " that has "PerturbationNumber=1"
respectively and then paste these to a file that is output file and repeat this process for the other files ( 2006Nov and etc ) and paste data in output file sequentially.
I appreciate and look foreward for any help in this issue.
MajidTry code below
Sub CombineBooks()
Dim wb As Workbook
Dim sourceSht As Worksheet
Dim destSht As Worksheet
Set destSht = ThisWorkbook.Sheets(1)
destSht.Cells.Clear
FolderName = "C:\temp\test\"
file = Dir(FolderName & "*.xlsx")
firstSht = True
Do While file <> ""
Set wb = Workbooks.Open(Filename:=FolderName & file, ReadOnly:=True)
Set sourceSht = wb.Sheets(1)
With sourceSht
sourceLastRow = .Range("A" & Rows.Count).End(xlUp).Row
If .Cells.AutoFilter Then
.Cells.AutoFilter 'turn off autofilter
End If
.Cells.AutoFilter Field:=6, Criteria1:="1"
If firstSht = True Then
Set copyRange = .Range("A1", .Range("E" & sourceLastRow)).SpecialCells(xlCellTypeVisible)
destSht.Range("F1") = "FileName"
firstSht = False
destNewRow = 1
Else
Set copyRange = .Range("A2", .Range("E" & sourceLastRow)).SpecialCells(xlCellTypeVisible)
destNewRow = destSht.Range("A" & Rows.Count).End(xlUp).Row + 1
End If
copyRange.Copy Destination:=destSht.Range("A" & destNewRow)
LastRow = destSht.Range("A" & Rows.Count).End(xlUp).Row
If destNewRow = 1 Then
destSht.Range("F2:F" & LastRow) = file
Else
destSht.Range("F" & destNewRow & ":F" & LastRow) = file
End If
End With
wb.Close savechanges:=False
file = Dir()
Loop
End Sub
jdweng -
Convert different types of files and merged them into one pdf
Hi, everyone. I'm girl from China.
There is folder containing severl files of different types, like doc, msg, jpeg etc. And I want to convert and merge them into one pdf following a certain order. I know that PDFmaker can do that nicely, but the problem is that I have like 3000+ fodlders that requires the same work.
I want to do it with VBA and Acrobat. I have a Acrobat XI Standard Version and a perfect license, by the way
And I have got the code(Thanks, Karl Heinz Kremer) of merging two pdfs into one, but how can I convert them into pdf first?
Thank you very much.
If I can finish this, I would like to publish my code on this forum.Wow, that's great news. But how should I add the Action?
1. There is no action named "Covert files into Pdf" in the tools panel....
And if I write Javascript code to do this action. How should I write it?
app.openDoc({
cPath: "/c/temp/myPic.jpg",
bUseConv: true
These code only works when I specify the path of the file.
If you know how, pls tell me.......... -
How do tou take multiple .pdf files and merge them into one?
I havefour different .pdf files that I'm trying to merge into one file. How can I do this?
File>Create PDF>From File.
Please post followups in the Acrobat forum.
Bob -
When I download firefox, using recommended setting, or my own, all the sub files/folders like plugins, modules, updater end up on the desktop as well as in the file location. And when I try to put them into the file location, they don't. And when I delete them, FireFox won't open. I tried deleting FireFox and reinstalling it multiple times, and a message pops up sometimes that says FireFox may not have installed correctly, so I follow the steps, but all the extra icons on my desktop don't go away. This has happened every time I have downloaded FireFox. The browser itself works, but I need to know how to get rid of these icons, but still be able to use FireFox. This is on a new computer, with Windows 7.
== I downloaded FireFox. ==
== User Agent ==
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6Managed to solve this myself. Just went to properties > hidden.
-
I accidentally deleted all of my Logic Pro X files and put them in my trash but now that I copied them back to my documents they all play in the wrong places in my projects
Buddhaguru wrote:
I know that Mac's don't have a roll back like PC's
They do. It's called Time Machine.
You need to reinstall all of your Apps. That should replace all of the support files you nuked. -
Has anyone got a script to read a list of email addresses from a Mail message header and put them into a group in Contacts?
Now Tony, I know you can't hear my tone on a forum post but I was not complaining, simply stating facts . This change brought several people in my office to a grinding halt in a long established workflow that is really rather simple (and I thought was already assumed from the original post above ):
1) Select a set of records in FileMaker Pro 12 and export only their e-mail addresses as a CSV file.
2) Open that CSV file in Excel.
3) Copy the column of e-mail address.
4) paste into the appropriate recipient field in Mail.
5) Send
If I were to complain it would be about Apple's typically opaque approach to updates. There is no granular explanation of why changes were made or even "what" changes were made.
Complaining is futile since Apple is Apple and is unlikely to change, but sometimes it is cathartic to "shout into the void" .
I had thought about doing something with a formula in Excel and your suggestion was simple and helpful. Again, however, it is only a workaround for a long established helpful behavior that Apple has inexplicably broken/removed in Mavericks Mail.
I, and the other posters here, would love to have the capability back rather than have to add previously unneeded steps to our workflows.
Ultimately we may add scripting steps to the FileMaker side to export the address lists with commas inserted already if Apple ends up having permanently removed this feature. -
Reading .txt files and put it into a TextArea
Hi all,
I got a problem! I have to make something like a messenger.
I want to put the written text into a .txt file, after that I have to get the text out of the .txt file and put in into a TextArea.
I would ike it to to that like this:
">User 1
Hello!
>User 2
Hi!
Now here are my questions:
1: What is the moet easy way to do this ?
2: How could i put Enters into a .txt file with Java ?
3: How could i read all the text from the .txt file and put it into a TextArea WITH ENTERS ?
Thanks for your help!
Greetings, Jasper Kouwenberguse JTextArea.read(new FileReader(fileName)) for reading.
and JTextArea.write(new FileWriter(fileName)) for writing.
The enters should be ok if the user press enter and adds a new line ("\n") to the text area component.
It will save the enter in the text file and load it correctly back to the text area.
If you want to add enter programmatically just add "\n" string to the text area component. -
I just stared having problems with importing files from nikon D810 into LR 5.7 it pop a window saying it can not read files on working on a imac 27" running yosemite on my mac pro after a few times it finally was able to read files and import them into LR I never had this problem before was there some kind of update that could of cause this?
-
I have two different itunes music files on my computer. How do I combine them into one file?
I don't think so. The only other ID I have is a developer id, and I didn't get that until several months after I got the phone. In addition purchases I made from the App Store onthe phone would sync up with It unes on the Mac meaning it would be the same id.
However I looked at the AppStore on my phone while it was connected to the Mac with iTunes open, and now the balance has changed to the same as the others. -
How do I get the pictures folders in photoshop 7 out of My window XP computer and put them into my new computer windows 8 photoshop12
I am so sorry for you and your situation. Were you using iCloud photostream?
Otherwise I do not see any chance for your precious photos.
Congrats anyway on the little darling! -
I have photos on my iphone 4 that i'm trying to transfer to iphoto. The problem is when I plug the phone in, it only wants to transfer the new photos, not all. How can I take all the photos off my phone and put them into iphoto? Even if there are duplicates, I'd like to make sure I get all the photos from my phone into iphoto. Thanks
To see all the photos on the phone, including photos that have already been imported into iPhoto, deselect the "Hide Photos Already Imported" checkbox. If the camera contains photos that have already been imported into iPhoto, those photos are hidden by default.
-
istalling third party instruments.. i have tried to go to application support and putting them into the sampler but they are still not showing up.. can someone help me
Hi
So these are EXS24 Sampler Instruments?
If yes... the .exs Instrument files need to go in
Library:Application Support:Logic:Sampler Instruments
Or
<User>:Library:Application Support:Logic:Sampler Instruments
CCT -
And put them into stand alone albums on my iPhone 4?
I want to take some pictures off the camera roll and put them into stand alone albums on my phone...how do I do this?
go to photos. click on edit. click on add. it will ask a name. then go into your camera roll. at top right click on arrow. then select the pics you want. then click done.
-
Trying to drag pdf files i have and combine them into one pdf file in the account i just purchased with Adobe. when i drag a pdf file over Adobe doesn't accept it. says it can not convert this type of file. but it is an Adobe file. Do I need to change it in some other form befor dragging it?
Hello djensen1x,
Could you please let me know what version of Acrobat are you using.
Also, tell me your workflow of combining those PDF files?
Please share the screenshot of the error message that you get.
Hope to get your response.
Regards,
Anubha
Maybe you are looking for
-
How do I use airplay to stream a DVD movie playing in my computer to display on my TV?
How do I use airplay to stream a DVD movie playing in my computer to display on my TV? I have a 2nd generation Apple TV and computer is a 2011 Macbook Pro. Processor 2.8 GHz Intel Core i7. Memory 4 GB 1333 MHz DDR3. Graphics Intel HD Graphics 3000
-
Java Mapping: payload as mail attachment and dynamic file name .
Hi, I have written this piece of java code. The code includes XPATH for fetching dynamic filename and the copysource( in, out ) to copy the content of payload as mail attchment. The code seems to work fine, when either of the functionality is impleme
-
Project Management ' unable to delete project set'
Hi we are using oracle11i (11.5.10.2) on windows 2000 server service pack 4,database version 10.2.0.3 and Oracle Project patch set Level 11i.PA.L while deleting prject sets we are getting error 'you have gained access to this page using the browser n
-
Custom screen or fields in VL01N transaction
Hi All, We have the requirement to add new tab or new fields in VL01N transaction. I have searched the forum but no confirmed answer or example. It will be great if some one can help us in this.
-
When I automate to sequence I get no audio transitions.
I am working with clips from my Sony PMW-200. When I automate a bunch of clips to sequence the video transitions are there, but no audio transitions. I have been using Premiere Pro for years and this has never happened to me before.