How to create different file names for every new document in Photoshop? - filenames

I have an A4 size document with 6 Photos, while I am trying to cut one photo from the original and create a new document the new file name is created as "Untitled-1".
Since I am using an Action to cut from original and paste it into the new document, every new file is opened with same name as "Untitled-1" and while saving it replaces the existing.
Is there any way to make every new document with sequence number or any different names for each file while create new document in Photoshop?
Or else please suggest if any script is available for the same.
Please find below screenshot for your clear understanding.
thanks in advance.
Full page image
Every new document name

Are you familiar with slices? It's beneath the crop tool - You can slice up your document the way you want it, then Export > Save for web, then each slice will save as an individual file.

Related

Replace a Picture in MS Word header with another in VBA

Using MS access I need to open a word document and change certain images within the header. Whilst I have the code to find and replace any text that I need, I do not quite understand how to replace an image keeping it to a specific width and height.
The header within the Word document is constructed using a basic table with 3 columns as depicted below. The image in the right hand column will need to change for a specific logo.
I have managed so far to add an image to the document using the following code which gives the expected result...
With WordDoc.StoryRanges(wdPrimaryHeaderStory)
.InlineShapes.AddPicture FileName:="test.jpg"
End With
I understand that this is due to me not specifying a specific location, size etc but I am struggling to find resources which would instead allow me to either remove and add a new image to the right column or just swap the images out.
EDIT 1:

Append multiple PDF files

I have about 600 PDF files that I want to add a single disclaimer page to the beginning of each of them. So, I need to find a way to merge two PDF documents where one file is always the same and and comes first and the second file is changing.
Please let me know how I can do this.
Thanks!
I found this:
http://gotofritz.net/blog/howto/joining-pdf-files-in-os-x-from-the-command-line/
So you could do something like this in a shell script:
#!/bin/bash
page1="disclaimer.pdf"
for f in {a.pdf b.pdf c.pdf}; do
"/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py" -o "$f" "$page1" "$f"
done
You can wrap this in an Applescript or automator workflow it you like.
Combine an unknown PDF with a known PDF
Automator can do this. You would save it as an application, so that you can drop the second file onto it. Your steps would be something like:
Get Specified Finder Items: Add the known PDF document here, the one that is “always the same and comes first”.
Combine PDF Pages
Move Finder Items: To: Combined Files. This will create a randomly-named file in the folder “Combined Files” which you will need to create.
If this Automator workflow is saved as an application, you can drop your second, "changing" file onto the application icon. The workflow will combine the two, putting the named file first.
Loop this workflow for each dropped file
In order to do this on multiple files at once, you will need to create a second workflow that loops through each dropped file and calls the above workflow. This second workflow is also created as an application. It has only one step:
Run Workflow: choose the workflow created in the previous step, and process items in batches of 1 at a time using 1 workflow.
Give the files a more usable name
That’s the basics. The obvious drawback is that all of the files have random names. That can be fixed by grabbing the original filename into a variable, and saving the new, combined document using that name in your new folder.
First, add four new steps to the top of the first workflow, in front of “Get Specified Finder Items”:
Run AppleScript
Set Value of Variable: name the variable filepath.
Run AppleScript
Set Value of Variable: name the variable filename.
Get Value of Variable: filepath
The first two steps save the full path to the dropped PDF. The second two steps get just the filename portion. The fifth new step pops the full path back into the workflow so that it can be combined with the known disclaimer.
Set the AppleScript in step 1 to:
on run {input, parameters}
return input
end run
Set the AppleScript in step 3 to:
on run {input, parameters}
tell application "Finder"
set filename to name of file input
end tell
end run
Then, add a step at the end to rename the file. After Move Finder Items add *Rename Finder Items. Choose “Name Single Item”, “Full name to” and then drag the variable filename up to the text box.

How to draw Matrix Code with PdfSharp?

I need to make a PDF report via PdfSharp. The report must include a QRCode, or data matrix code, but I can't seem to be able to draw it on the page.
The values it's asking for are value as String and length as Integer so here's what I'm doing:
Dim myNewCode As New PdfSharp.Drawing.BarCodes.CodeDataMatrix("1234567890", 10)
Then I try to draw it:
gfx.DrawMatrixCode(myNewCode, myXPoint)
It asks for an XPoint location so I set it to this:
Dim myXPoint As New XPoint(500,500)
Which only needs values for x and y.
It compiles OK but when I try to open the file I get the next error
An error exists on this page. Acrobat may not display the page correctly. Please contact the person who created the PDF document to correct the problem
My Acrobat version is 11.0.5, and there is no problem opening other PDF files which already contain these kind of codes.
Specify the size to get a correct PDF file:
var myXSize = new XSize(100, 100);
var myNewCode = new PdfSharp.Drawing.BarCodes.CodeDataMatrix("1234567890", 10, myXSize);
var myXPoint = new XPoint(200, 300);
gfx.DrawMatrixCode(myNewCode, myXPoint);
Please note that due to legal reasons, the open source version of PDFsharp does not include the implementation of the Data Matrix Code and shows dummy images instead.
Another option would be to use a 3rd party library (ZXing) to generate the QR Code bitmap and draw it as a bitmap with DrawImage() on the PDF.

vb.net writing files of specific size

I am creating an application whereby I need to write files (many, many of them). However, I don't want to write files that are too big because the program that consumes them will crash :)
Essentially, I would like to create files that are no larger than a specific size (possibly 5MB). My data is of CSV format and I will be writing line by line or into some stringbuilder to create the file I need.
Question: Is there a way to write data and create a set of files that are no larger than a set size?
I assume you are creating CSV rows 1 at a time.
If you are using a StreamWriter on the file (hopefully you are, no need to hold it all in memory):
Create the new record (a string of CSV items).
Look at the StreamWriter's BaseStream.Length property (Caveat - You need to use AutoFlush to make that property correct with the data that's been written previously).
Add your stream position, new record's length, and your line separator's length (usually 1 or 2, depending on Cr, Lf, or CrLf), and see if it exceeds your threshold.
If no, write the line feed, the record, and continue. If yes, close your StreamWriter and open a new one for a new file, write the record, and continue.

How to create hyperlink from a pdf to another pdf to a specified page using itext

I am using itext to create a pdf. As a final result i am downloading a zip file.After extracting it i am having directory structure as follows:-
main dir
|
|_ evidence_dir/abc.pdf
|
|_xyz.pdf
i am using this code to create the link in pdf
chunk = new Chunk( "Link" ).setAction(PdfAction.gotoRemotePage("evidence_dir/abc.pdf", "6", false, true ));
this code is for file xyz.pdf. I am getting the link create but when clicking on the link current pdf getting closed and then nothing happened.
Can anybody please help me.
Thanks,
Manish
I've create a small standalone example that shows how to create a RemoteGoto in a PDF using iText. You can download the ZIP with the resulting PDFs here. It works for me, can you check if it works for you?
Several things aren't clear from your question.
Is "6" present as a named destination in your abc.pdf? (I created an abc.pdf file with a destination named "dest")
Is "6" a named destination defined by a PDF string? (cf. your false parameter)
Are you aware of the limitations of opening a new PDF viewer window? (cf. your true parameter)
Update:
In your comment, you say that "6" should be a number, but in your code, you use a string. It's normal that that doesn't work, strings aren't numbers. Please take a look at the RemoteGoToPage example to see how it's done.
Update 2
In one of the comments, I'm asked if you can link to a specific word in an existing PDF from an HTML-link. That's a completely different question. You can do this using Open Parameters. On page 7 of this spec, you can find more info about the search parameter:
Opens the Search UI and performs a search for the specified word list
in the document. Matching words are highlighted in the document.