The value of PDF file printed via the script name

Hi people!

I have a little problem with the generation of a PDF file. First my Workflow:

I have an InDesign document with 6 pages. This document is merged with a databasefile containing 100 records. After it is merged, we need to generate a PDF file. This PDF file is opened in acrobat. In the document, I am looking for one ID for each record so I can split the document to 100 files (each with 6 pages) and name by the ID that I found.

The Acrobat script is finished and functional. I thought: the InDesign script is over, too. But I was wrong-. -.

I merged the databasefile with the document and it has exported to PDF. But after export, we noticed that the Acrobat script isn't finding the adressheader where ID is in. The script only noticed the text after this header. The result is, as get-Acrobat always 'null' as ID

If print us the PDF with our PDFprinter, the header could be read by our script of Acrobat. I don't know why this is... But now, I changed the script to print the files through our PDF printer. Unfortunately I can not set a name for my exported file - do you know if it is possible to print PDF files without asking for confirmation after each other as well as with a via script name?

Here you can see the old writing for InDesign and after her, the sript Acrobat. Maybe I made a mistake by generating my PDFexport and have no need to use the printer?

INDESIGN SCRIPT:

/**
* invite filebrowser and stores the name and path of the file in variable
*/
var sourceDocument = File.openDialog ("Bitte Indesign-Dokument Park", "*.indd", false);

/**
* stores the only prefix of file name to use as the new file name
*/
newName var = sourceDocument.name.substr (0, sourceDocument.name.length - 5);

/**
stores in folder where the file is stored
*/
var dbSourceFolder = sourceDocument.parent + "/"; "

/**
* guests for databasefile, where production is expected to begin
*/
var dbstartfile = File.openDialog ("Start-Datenbankdatei of Bitte Park", "*.txt", false);

/**
* Gets databasefile basename
*/
var dbstartfilename = dbstartfile.name.slice (0, dbstartfile.name.search(/_Teil+/));

/**
* Gets number of first databasefile
*/
var i = dbstartfile.name.slice (dbstartfile.name.search(/_Teil+/) + 5) .slice (0, -4);

/**
* generates the path and name of the first databasefile to use
*/
var dbSource = dbstartfile;

/**
* set PDF preset to generate PDFS
*/
var PDFPreset = app.pdfExportPresets.item ("GAG - PDF");

/**
* stop throwing alerts
*/
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;

message will be thrown if databasefile is not existing
If (dbSource.exists == false) {}
reboot to launch alerts
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
Alert ("File" + dbSourceFolder + dbprefix + "_Teil" + i + ".txt konnte nicht werden found! \n\rBitte starten Sie den procedure Rubis und Sie die right Datenbankdatei one enter.");
}
another process begins
else {}
even if (dbSource.exists == true) {}
Opens the document indesign source without displaying
mergeDocument = app.open (File (sourceDocument), false);
defines what databasefile should be used for data merging
mergeDocument.dataMergeProperties.selectDataSource (File (dbSource));
starts the file database and the indesign document merging
mergeDocument.dataMergeProperties.mergeRecords ();
document generated in PDF export
app.activeDocument.exportFile (ExportFormat.pdfType, File(sourceDocument.parent+"/"+newName+"_Teil"+i+".pdf"), false, PDFPreset);
farm open indesign document
mergeDocument.close (SaveOptions.no);
i ++ ;

change the name of the database file to get the next file
dbSource = File(dbSource.parent+"/"+dbstartfilename+"_Teil"+i+".txt");
}
}
reboot to launch alerts
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
Alert ("PDF-Generierung sky!");

SCRIPT ACROBAT:


/**
* Path where files should be saved
* Special characters like spaces must be preceded of--------.
* If you want to change the folder, use the following form:
* ' / DriveLetter/foldername /... /LastFolderName/.
* Be careful not to forget the / before and after the location
*/
filepath var = "/ c/pdf_split_test / ';

/**
* Number of display pages - do not hesitate to change
*/

pageType = app.prompt var ("Please die Seitenzahl der presentations one gewunschte.", "");
Alert (PAGETYPE);

/**
to search for regular expression
*/

var idNumber = / 08\d\d\d\d\-\d\d\d\-\d\d\d\d\d-\d\d\d-\d\d/g;

/**
* If possible this function gets the number sought as string
*
@param string of revenge that is to be found in the document
* @return null if rematch is not found or a string if the rematch is
*/

function ExtractFromDocument (reMatch) {}
try {}
var Out = new Object();
for (var i = 0; i < 1; i ++)
{
numWords = this.getPageNumWords (i);
var PageText = ' ';
for (var j = 0; j < 30; j ++) {}
var Word = this.getPageNthWord (i, j, false);
PageText += Word;
}
var strMatches = PageText.match (reMatch);
If (strMatches == null) continue;
}
Return strMatches;
} catch (e)
{
App.Alert ("processing error:" + e)
}
}

/**
* tries to load given filename (excerpt number)
*
@param string file name of the file that should be checked
@param n number of iterate when checking files
* @return true if the file exists or false otherwise
*/

function checkIfFileExists (filename, n) {}
var existingDoc = false;
try {}
If (n == 0) {}
var checkDoc = app.openDoc(filepath+filename+"-000.pdf");
} else {}
var checkDoc = app.openDoc(filepath+filename+"-000_"+n+".pdf");
}
checkDoc.closeDoc ();
existingDoc = true;
} catch (e) {}
}
If (existingDoc == true) {}
n = n + 1;
n = checkIfFileExists (filename, n);
}
return n;
}

var pageAmount = this.numPages;
for (i = 0; I < pageAmount; i + pageType) {}
var filename = ExtractFromDocument (idNumber);
fileExistence = checkIfFileExists (filename, 0);
If (fileExistence! = 0) {}

this.extractPages ({nEnd:(pageType-1), cPath: filepath + filename + "-000_" + fileExistence + ".pdf"});
} else {}
this.extractPages ({nEnd:(pageType-1), cPath: filepath + filename + ""-000.pdf ""});
}
this.deletePages ({nStart:0, nEnd: pageType-1});
}

Hello

I have a little problem with the generation of a PDF file. First my Workflow:

I have an InDesign document with 6 pages. This document is merged with a databasefile containing 100 records. After it is merged, we need to generate a PDF file. This PDF file is opened in acrobat. In the document, I am looking for one ID for each record so I can split the document to 100 files (each with 6 pages) and name by the ID that I found.

Why you are not exporting 6 pages PDF directly from InDesign?

Robin

www.adobescripts.co.UK

Tags: InDesign

Similar Questions

  • PDF file print symbols instead of letters/numbers

    Hello

    PDF file prints (square) symbols instead of letters/numbers. I've tried different printers, assume that is not a defect in the print settings that the problem occurs with all used printers. What can I do? Would appreciate a step by step description possible solutions. Thank you.

    Open the application book fonts. Select all the fonts, and then select "Validate fonts" in the file menu.

    Additional instructions can be found here: the basics of the Mac: font - Apple Support book

  • I want to save a PDF file converted (via your clouds product) on my desk.  I want a paper copy on my drive and not a link via Chrome of your cloud.  How can I do this?

    I want to save a PDF file converted (via your clouds product) on my desk.  I want a paper copy on my drive and not a link via Chrome of your cloud.  How can I do this?

    Hi WalterFranco,

    When you convert your files using ExportPDF or Adobe PDF package, the files are automatically saved in your online account. But, you can log on to your account on https://cloud.acrobat.com/files, select the file that you want to store on your hard drive, and then click the link to download at the top of the list of files.

    Please let us know how it goes.

    Best,
    Sara

  • How to put files tif via a script in an indesign document?

    How to put files tif via a script in an indesign document?

    What attribute of the type you use when you build your dialogue?

    myDLG = new Window ("range");

  • How can I configure the element with the script names?

    Could Hello someone give me a hand?

    I created symbols on the stage of this script below.

    ------------------------------------------------------

    for (k = 0; k < 5; k ++) {}

    sym.createChildSymbol ("mySymB", "Stage");

    }

    ------------------------------------------------------

    How can I configure the element with the script names?

    Because, when I try to control a symbol by using the getSymbol("---") command.

    I need to know the name of the item given to each symbol.

    Concerning

    Yes, you're right.

    Using 'Code-Example' If you write sym.getSymbol ("mySymB") that edge returns the undefined value.

    With "Drag-and-drop-Example", you can use sym.getChildSymbols ().

  • PDF files download via imap with the incorrect file size and is considered to be "corrupted".

    Hello

    I have a computer that is using thunderbird for imap emails. Any time I try to view a pdf, the open used attachment attachment and is reported as damaged. I downloaded a PDF directly from godaddy (mail host) and I can view the file properly. I also noticed that the file I tested was 105K when shown on the godaddy webmail but it was only 103K when appearing as an attachment under thunderbird. I also forwarded the email to myself since the webmail and when I open the email of forwareded, the size of the file is correct and the pdf file now opens. I would like to be able to open PDF files with thunderbird without having to send them to myself since the webmail. Are there settings I could change so that PDF files will be correct the first time?

    Thank you

    Try this: open Tools/Options/Advanced/general/Config. Editor, double-click on the mail.server.default.fetch_by_chunks preference to change its value from true to false, close the Config. Editor, OK, restart TB and see if you still have problems to open the attachments.

  • PDF to print via APEX earphone


    I'm trying to set up printing via the listener of the APEX and I am struggling to understand it.  I currently use an Oracle HTTP server as the web server for APEX.  I installed the listener of the APEX and configured.  If I connect via the listener of the APEX, a PDF works fine.  If I connect through the Oracle HTTP server, I get an error with a PDF file.  I have to communicate with the listener of the APEX for the printing of the PDF?  I thought that I could configure the listener of the APEX for the printing of the PDF on the backend and still connect via an Oracle HTTP server.  I use APEX APEX receiver 2.0.5 and Oracle DB 11.1.0.7 4.2.3.

    So do you have other questions?  If this isn't the case, then please connect it as a closed question and award points as see fit you...

    Thank you

    Tony Miller

    Software LuvMuffin

  • HP Envy 4524: Printer PDF files print does not correctly

    I have two files: a jpeg and a single pdf, card, size A4.  They look identical when displayed on the screen, but when I print, the jpeg format is perfect and the pdf smear through it. This is a new printer and I had no such problem on my previous HP Photosmart 6510. Any ideas?

    Hello @pamhans, greetings!

    Welcome to the HP Forum! It is a wonderful location to converse with the community, get help and advice.

    I understand that you are having problems when printing an image in PDF format. I would like to help with that.

    First of all, I would like to know the app that you use to open / print PDF files. You use "Adobe reader" or another application?

    If you do not use the Adobe reader software, please install Adobe reader, and then try to print the pdf image.

    If you already use Adobe reader software, follow the steps below:

    1. try the option "Print as image":

    • Choose file > print and then click Advanced.
    • Select print as Image.
    • Click OK to close the Advanced Print Setup dialog box, and then click OK to print.

    2. install the last update:

    • Open Acrobat or Reader.
    • Choose Help > check for updates. If a new update is available, it installs automatically.
    • Once installed, restart your computer.
    • Print the PDF again.

    In addition, please go through the steps here: http://hp.care/2dSDxCD

    Please let me know if that solves the problem, or if you need assistance

    See you soon

    Please click on 'acceptable' on the post that solves your problem to help others to find the solution. To show gratitude for my help, please click the 'Thumbs Up icon' below!

  • DeskJet 3050 J610: PDF files print does not correctly

    Hello

    I have a HP Deskjet 3050 J610 Series all-in-One Printer using Windows 10. It is not wireless I'm using a USB port for printing.

    I used the HP printer Assistant, make sure that the printer has been updated with the latest version of the driver. I ran the cleaningprogram.

    My problem is, when I try to print a PDF file all the text within the framework of the formula is clearly printed. It is printed, but it is very indifferently.

    Is there a kind of setttings that can handle this?

    If I print the PDF file and tick print as image then it prints all text clearly.

    Looking forward to hear from you

    By Lunau

    Hi @PerLunau,

    Welcome to the Forums of HP Support! I see that you have problems printing when printing PDF documents, but when to print as an image solves the problem. I would like to help you today. If this helps you to find a solution, please click on the button "Accept as Solution" down below in this message. If you want to say thanks for my effort to help, click on the 'Thumbs Up' to give me a Kudos.

    Make sure you have the latest version of Adobe Reader or Acrobat.

    Please take a look at this document for PDF printing problems, PDF print troubleshoot | Acrobat, Reader.

    I hope this helps. Good day! Thank you.

  • Photosmart 6520 does not pdf file print.

    Just bought a HP Photosmart 6520, WiFi, Win Vista, Explorer 8 configuration,

    and so far, everything seems to be printing with the exception of

    When I try to print a PDF file.

    Any help would be appreiated,

    Read

    Hello

    Thank you for your response.

    Because the problem is now solved, do not follow the other steps or the first step. You can copy these steps and save it in a file for later reference. In case, if the problem happens again in the future, then you can try more of these measures. For now, do not follow step.

    Good impression.

  • HP Envy 7640: PDF files print on my new HP cannot envy 7640

    I am running Windows 7 Home Premium 64 - Bit, and I can print Word, Excel, text, and image files. I can't print PDF files. I tried to use the Advanced setting of the printing of 'Print as Image' and PDF files does not always print. I checked the Adobe updates and none is available. I have Adobe Reader XI (version 11.0.16).

    Does anyone have any suggestions?

    Thank you

    Linda

    Remove and uninstall Acrobat Reader. Now download and install Acrobat Reader DC from the Adobe web site. Try now.

  • my new computer with windows 8 will not print my pdf files, print everything well.

    I have a new computer HP running windows 8. my printer works fine except when I want to print a pdf file. If I install the printer drivers, it erases all my Outlook folders.
     
    I'm so close pitch on this windows 8.
     
    Linda Hewett

    Got it to work.  I discovered that the updates have been downloaded, but the computer needed to restart to get them set up.  PDF does not open until this happened.  By chance, I noticed a message that says my computer will re-start in two days to config updates.  I chose restart and it took 40 minutes for an update installation and config.  Fingers crossed I checked my pdf and they ran.  problem solved.

  • How to select a block of text to the Script name?

    Hello

    I have listed the text block in the code below,

    UIDRef uidreference = stories->GetNthTextModelUID(0);

    InterfacePtr<ITextModel> TheTextModel (uidreference, UseDefaultIID());

    if (TheTextModel is NOTHING)

    Break;

    IFrameList * Frames = TheTextModel->QueryFrameList();

    if (Frameworks is NOTHING)

    Break;

    AFrameUID UID = images->GetNthFrameUID(0);

    I need to select the block of text by Script name (Windows-> Utitities-> Script title).

    Please suggest the solution above the problem.

    Try,

    InterfacePtr script (content, UseDefaultIID());

    If {(script)

    ScriptLabelValue = script PMString-> GetTag();

    CAlert::WarningAlert (scriptLabelValue);

    }

  • several paths to the script name change

    I placed a script issue in the forum "running scripts Illustrator." If you are a scripter, I would appreciate your help. It has the same name as this thread.

    Thank you

    Ray

    function() {return A.apply (null, [this] .concat ($A (arguments)))}

    This convinced me of my need to learn scripting. Now, if I can find just the motivation after this fire drill.

    Scribble autour with scripts (Javascript in particular) is strong enough to bet that the efforts will pay off. Learning is really no more difficult than to read a book (and there are tons of them). In addition to sometimes dinking round automate things in Illustrator, it applies to other applications (especially InDesign and Acrobat) and work of web and it will open a world of possibilities for you in Flash. (Scripting, this is where lies the real power of the Flash.)

    "Learning Javascript" well enough to make productive use of it is just learn a quite simple and logical syntax wisely and understand a small set of logical process: steps in the procedure (what, then, then do this), loops (as long as this, do this) and conditions (if then this, otherwise do).

    Subsequently, you jump in. The only "difficult" part of it is noodling on the specifics of the model script (objects, properties, and methods) for the specific application, for you are the script. In practice, it's more of a process of "confusing it" than a "learning curve". It's a bit like in chess. It's fun, when you're in the mood for it.

    JET

  • LaserJet P2055 very slow in the scanned PDF files printing

    We have three printers Laserjet P2055DN.

    They have all of the extreme difficulties in printing scanned PDFs, especially of our Toshiba e_Studio 451 Copier/scanner.

    The printer that I'm testing has 384 MB of ram. The OS is Windows 7 Pro 32-bit.

    The drivers and firmware are later (October 25, 2010).

    Each page takes 15 minutes or longer to print.

    One of the printers is hosted on Fedora 13 and has the same problem.

    Just loaded on 11 February 2011 PCL6 Windows 7 32 bit driver.

    It works!

    Will have to try on February 11, 2011 PS driver then.

    Yippee.

Maybe you are looking for