What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Batch Processing of PDF files to JPG


Sheran Jaddoo

New Member
Messages
1
Likes
0
i'm having this aweful issue of PDF to JPG conversions


Now the files are in pdf format and their sizes are quite large, round 15000px height maybe


I only want my jpg files to be 700px high, for this once my pdf files have been opened in photoshop, i created an action for this, that part is ok


I tried batch conversion, using actions as well, but it's still not that automatic because the pdf window still pops up every time a new pdf is being opened on photoshop asking me for how high i want my pdf file. so if i have 600 pdfs (i do!) it's 600 times i have to type in 700 px in the height box.


Plus the pdf files have been partitioned into folders and subfolders, the actions also have a problem: they don't save it in the same folder as from where i opened them.


is there any way out of this ?
 
I used to meet the same problem with you .YOU can try the following code to convert pdf to jpeg easily:

namespace RE__Test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

public static string FolderName = "c:/";

private void button1_Click(object sender, EventArgs e)
{
string fileName = FolderName + "Sample.pdf";

REDocument doc = REFile.OpenDocumentFile(fileName, new PDFDecoder());//use PDFDecoder open a pdf file

int pageCount = doc.GetPageCount();//get pdf's page count

for (int pgIdx = 0; pgIdx < pageCount; pgIdx++)
{
BasePage aPage = doc.GetPage(pgIdx);//get page from REDocument

try
{
REImage img = (REImage)aPage.ToImage();//translate page to image
REFile.SaveImageFile(img, FolderName + "output" + pgIdx + ".jpg", new JPGEncoder());//save image
}
catch (Exception)
{
Debug.WriteLine("Fail to display page " + pgIdx);
 

Back
Top