Automatic update of image file whenever i change - photoshop

I am new to photoshop. I am working in psd file and save that result output to .png format in different location. Am working with lots of file undergoes many changes.
Is there any possibility to update my png file if any changes occured in my psd file.
Guide me to sort out this difficulty.
Thanks in Advance.

You can write a script to save your document and then hook it up to specific events in Photoshop's 'Scripts Event Manager' dialog. To write your script you'll need to look at the 'saveAs' method on the activeDocument and the PNGSaveOptions object. You can find all the info you need in the Javascript Ref Guide document in your Photoshop install directory.
You'll wind up with something like this:
var doc = app.activeDocument;
var pngOptions = new PNGSaveOptions();
//set a bunch of pngOptions as needed
doc.saveAs(new File("/c/temp/temp.png"), pngOptions)

Related

What do I should use for saving a text like a pdf in gdscript

I want to make a multi-device software with godot engine and I want to make it as lite as I can, so I just want to use a Line edit node and a button for saving the text but, is there any way to save it as .txt and .pdf files with code or I need an extra plugin?
Writing a plain text file is relatively easy:
var file = File.new()
file.open("user://some_file.txt", File.WRITE)
file.store_string("Some text")
file.close()
PDF is more difficult. I don't think that there are any out of the box solutions. But remember that PDF is also just a text file with specific commands embedded into the text. You would have to study the specifications of a PDF file and then generate the required structures yourself via the method described above.

Is there a way to set a file name when jspdf output()

My site draws a column chart. I have a button to save it as a PDF file showing it before saving.
The way it works now is this.
google.visualization draws the chart.
html2canvas takes a screenshot of the chart.
jsPDF inserts the screenshot in a PDF file and shows it to the user.
The problem is the name of the PDF file. It is something like 5d78c1eb-0829-4e7e-8ffc-71cf1f102f56.pdf and the url is blob:http://example.com/5d78c1eb-0829-4e7e-8ffc-71cf1f102f56
When user sees the PDF and clicks save he receives this awful file name.
Now I show the PDF this way:
window.open(doc.output('bloburl'), '_blank');
I can set desired file name if I change this line to this:
doc.save('sample-file.pdf');
But in such a case the file just downloads but I need to show it first.
Is there a way to show the PDF and give it a desirable name? I tried this:
window.open(doc.output('bloburl', {filename: 'myFileName.pdf'}), '_blank');
But it did not help.
Another way I see is not showing the PDF from jsPDF, but sending images to the server and making a PDF file there using TCPDF. The files made with TCPDF can have a name I give it, but I think it is dumb to send the images there and back.
So the question is how can I make a PDF and show it to the user with the name I want?
At the moment the answer is no. You can download it directly, as mentioned in the accepted answer of this question: Download with filename
But you create an objectUrl and therefore the filename is always the url.
Maybe you could create an browser-extension for this...but I haven't had the time to try yet. Furthermore, you can't expect your visitors to have the extension installed.

Illustrator/PS images when sending to another computer?

I'm not sure how Photoshop works but when I receive an AI file from another computer I get an error regarding the images:
'Could not find the link file 'exampleimage.jpg'.
So I'm guessing the other person would have to send me the images separately?
Is this how Illustrator works?
I'm sure for Photoshop you don't have to do this?
Any info would be helpful.
Cheers
In Illustrator, if you go to menu File/Place, this will allow you to place other art files directly into your open illustrator document. If someone gives you that illustrator file and they do not give the "placed" files as well, when you open the illustrator document it will give you that error message because it cannot locate those files that were placed.
While using the "place" command in Illustrator, if the "link" check box is selected, anytime a placed file into illustrator gets edited and saved outside of illustrator, the edits made to that placed file will update the changes in Adobe Illustrator.
If the photos in their document are not embedded, you will need the images separately. Once you have the images, when you open the file on the new computer, you may need to manually associate the photos with each placeholder to make sure it renders properly.

ABCpdf damages PDF files

I am trying to do something really simple with ABCpdf. My goal is to add page numbers to existing PDFs (Generated through telerik - PDF export).
The problem I am having is that after reading a PDF and then saving it the file becomes corrupt.
My code:
Doc pdfDocument = new Doc();
pdfDocument.Read(path);
MemoryStream outputMemoryStream = new MemoryStream();
pdfDocument.Save(outputMemoryStream);
pdfDocument.Clear();
Response.BinaryWrite(outputMemoryStream.ToArray());
outputMemoryStream.Close();
Any advice would be greatly appreciated.
I am using ABCpdf 8.
Take a look at my answer Add page numbers to a Pdf document
This explains how to add page numbering to the pdf chain.
Looking at your code the issue seams to be that you are rewritting to the current file in memory. Try reading the file in creating a new file with the added page numbering then if you need to, delete the first document and rename the second.

picture is used by another process

in my windows application there is a image saving process.i can save different images.the images details will seen in a grid ,when i click the corresponding row in grid the image will shown in a picturebox.i want to delete the open picture by pressing the delete key.i used the
"deletefile(path)" code for this operation.but there is an error that "This file is used by another process."if anyone knows the solution for this problem please help me.thank you.
Do you have a reference to a Bitmap object created from that file ? If so, the Bitmap object is locking the file and will prevent you from deleting it.
The problem is not where you delete your file, it lies in how you open your image to display it. Could you maybe add some code showing how you load your image ?
When you load an image using something list Bitmap.FromFile, the Bitmap object keeps a lock on the file until it is disposed. So you could simply use the
using(Bitmap bmp = Bitmap.FromFile(path))
{
/* The code using the bitmap to display it goes here */
}
construct to force it to release the file once you do not need it. This will prevent it from locking. The reason it locks is that it does not load the whole bitmap in memory when you create the bitmap object, it loads it lazily on demand, so it needs to keep a lock on the file.
Open the imagefile using Image.FromStream and make sure you close the stream after the image is loaded. That way you sould have no locks on the file.
Added after comment.
I don't have Visual Studio at hand and I'm a c# guy but it should look something like this.
Dim stream As New FileStream(specified_path, FileMode.Open)
Dim image As Image = Image.FromStream(stream)
picturebox1.image = image
stream.Close()