Convert symlink to directory
Hi,
I have recently installed an additional SSD to my iMac 2011. I had OSX 10.8.2 installed on the (spinning) HD. I then installed 10.8.2 onto SSD. To make life easy at first I have weirdly managed to symlink the SSD/Users/useraccount to the HD/Users/useraccount.
Now I would like to use the HD as a usual data disk and remove the /Users/useraccount root nodes in its tree. Also, I would like only the "Documents" directory in a regular SSD/Users/useraccount to symlink to the data on the HD. Unfortunately I cannot because SSD/Users/useraccount is just a symlink, it does not contain any directories of its own. Can I convert that SSD/Users/useraccount back (from a symlink) to a normal directory? I cannot remove it because it is the useraccount I have installed the OSX out of. Thanks.
Regards.
Pierre
Hi Linc,
Back up is done as the SSD/Users/useraccount, user1 say, links to the HD which can be considered as just containing data. What do you mean to move link out of the way? If I log under user1 then it is hard to move it out as I am actively using that user1 link. What do you mean by home folder?
To summarize, I installed osx on SSD using user1. So, Users/user1 was created. Then I linked SSD/Users/user1 to the old user1 on HD. I realized too late that it was not proper. Now I want to revert back SSD/Users/user1 to a normal account and link its Document folder onto the Document folder on HD. It seems that logging as another admin account, user2 say, and changing the name of user1 into user1.bak and creating a user1 directory again, does not do the trick as logging as user1 again make the system use the user1.bak link still.
Similar Messages
-
How can I convert the volume directory into a single file installer?
How can I convert the volume directory into a single file installer? I would like to hide all the miscillaneous files that I don't care for and be able to have the installer double click a single file and have it automatically install.
On the second prompt screen when prompted 'What kind of self-extracting Zip file file do you want to make?'
Are you choosing the second option (self-extracting Zip file for software installation)?
I have a word file that I created to help me remember - is there anyway to email it to you? -
How to convert javax.naming.directory.Attributes to .String
hi,
i am getting values from ldap server.
but here i want to assin this values to string?
how?
Attributes det1 = ctx.getAttributes("cn="+t1+"", attrIDs3);
String str111=det1;
here i am getting error like this
Incompatible type for declaration. Can't convert javax.naming.directory.Attributes to java.lang.String
can any one help how to overcome and this values how to equal to string?
jpullareddynow i got answer,i solved
my self for solution
jpullareddy -
Finding the UNC path of a symlink'ed directory
Hi Scripting Guys,
I have multiple powershell scripts which access data files on a remote networked machine working through a symlink on the local machine. This way the remote fiile location isn't coded in the scripts, and if we decide to change the location of the data then
only the symlink needs to be recreated. So, for example, "c:\my_scripting\my_symlink\" in fact takes you to "\\remote_machine\my_data\"
In a script I am working on now, I have a need to be able to retrieve the UNC path of the remote data directory, in other words - where is my_symlink pointing to?
Can you help me with this please?
Cheers,
ColinHere's my solution so far (assuming only one reparse point in the local starting directory):
# get the remote path associated with my_symlink
[string] $uncPath = &cmd /C dir /AL *
$uncPath = $uncPath.Split("[`[`]]")[1]
# get the logical disk object
$networkDrive = $uncPath.SubString(0,2)
$logicalDisk = Gwmi Win32_LogicalDisk -filter "DriveType = 4 AND DeviceID = '$networkDrive'"
# replace the network drive letter with provider name
$uncPath = $uncPath.Replace($networkDrive, $logicalDisk.ProviderName) -
Can't convert llb to directory
I have a pop-up keyboard llb someone shared. When I open it, the convert to directory button is disabled, as are the cut and copy buttons. I need to extract this.
Why is it doing this?
Thanks,
Jim
Solved!
Go to Solution.
Attachments:
HMI_PopUp_KB.llb 206 KBIn the llb manager, go up one folder, then select the llb file. Now you can convert it to a folder.
LabVIEW Champion . Do more with less code and in less time . -
Deleting Documents folder and replacing with symlink - Downsides?
Background:
I have a new iMac with the dual internal drive option (SSD + HDD) running Lion. I am trying to set up the system to have the OS and applications on the SSD with documents and media on the HDD. In researching my options I found three paths often suggested:
1. Create folders in the HDD and save your documents there + point applications like iTunes and iPhoto to the HDD for storage.
2. Move your entire home folder to the HDD.
3. Replace certain folders of your home folder with symbolic links that point to the actual folders in the HDD (i.e., Documents, Downloads, Movies, Pictures, Public) + leave certain folders in the SDD (i.e., Library, Desktop, Music) + point certain applications to the HDD for storage.
After weighing the pros and cons of the options, I plan on using option number 3. Option 1 required the least "advanced" work, but had the downside of needing to change preferences in all my programs that default to folders like Downloads to the HDD as well as the good chance that I or others in my family would forget to navigate to the HDD to save documents. Option 2, moving the entire home folder seemed simple after reading the steps, but came with two main downsides: 1) warnings not being able to boot should the OS stop recognizing to look to the HDD for the user account and messing up the library and 2) not gaining the performance boost of keeping certain things on the SSD (e.g., the library file of iTunes and Aperture, files for current active projects kept on the Desktop).
That left me with Option 3, the one with the most setup work, but hopefully a good balance of later ease and performance.
Question:
In order to set up Option 3, my understanding is that I need to create a new folder in the HDD, delete the usual folder in the user home folder, and then create a symlink that lives in the user home folder so programs reference it and seemlessly access the folder in the HDD.
Does this really work without any problems? In order to delete folders like Documents and Downloads, you need to ignore warnings that say the folder "can’t be modified or deleted because it’s required by Mac OS X" and then use terminal commands to do so.
Of course, I plan to replace these folders with symlinks, so I think all should be fine and applications will just see the newly created folder without a hitch. I just want to be sure.
Here are some links to articles outlining the method:
http://gigaom.com/apple/how-to-create-and-use-symlinks-on-a-mac/
http://macperformanceguide.com/SettingUp-Relocating-Documents.html
http://martinbay.net/how-to-move-user-folder/
Thanks for the help!Just a note... I've noticed a problem in some sandbox apps when trying to save a file to the symlinked Documents directory.. depending on how the app saves the file, it might throw an error.
-
Convert PDFs to Word, RTF, spreadsheets or other formats
This question was posted in response to the following article: http://help.adobe.com/en_US/acrobat/X/pro/using/WS58a04a822e3e50102bd615109794195ff-7eeb.w .html
How do I convert an entire directory of PDFs to a text format? I would prefer not to have to do them one by one.
-
I notice that when I publish locally to my hard drive to review a set of slides, I see a folder full of files. If I click on index.htm within the folder, I can launch the slides.
When I publish to the Adobe Connect Pro server, I merely see a url for the link to the course.
I'm not sure what this url link represents (as far as the file format is concerned):
Has the presentation been converted to different file format than what is published on my local drive? If so, what format is it in?
If the presentation has not been converted, does the directory structured published to my local drive get replicated on the Adobe Connect Pro server, and the url is merely a link to the "starting file " within that folder (say, index.htm)?The published output does not differ between publishing locally and publishing to Connect. The URL on the Connect server does, ultimately, point to the Index.htm or viewer.swf file.
-
Slow processing and getting opening errors/warnings
I've modified the PDF Binder sample to get a plugin that would open PDF's and Tif files, and save them as PDF/A-1b (code below).
It's working. The problem: it's processing too slow (compared with the Actions batch processing)... and I've been getting warnings/and errors about "The imput file is corrupt or of an unknown/unsupported type" type. This is stopping my batch process until I click OK, and the it continues.
I am trying to process a few thousand of tif files now. I tried first to use the Batch processing capability built in the Acrobat X... an it works, but only with the first 255 documents in the folder... then gives an "insufficient disk space" message for the rest of the files in the directory.
So, 2 questions: Does anyone knows why it is so slow processing the tiff files and... how I can make my code "silent" so it does not wait for the OK after the message??
Thanks in advance.
The code:
ADOBE SYSTEMS INCORPORATED
Copyright (C) 1998-2006 Adobe Systems Incorporated
All rights reserved.
NOTICE: Adobe permits you to use, modify, and distribute this file
in accordance with the terms of the Adobe license agreement
accompanying it. If you have received this file from a source other
than Adobe, then your use, modification, or distribution of it
requires the prior written permission of Adobe.
\file PDFBinder.cpp
- Implements a method to convert multiple files into PDFs and bind the PDFs
into one PDF file. The code shows how to use AVConversionToPDFHandler to
convert files to PDF and how to use PDDocInsertPages() to combind PDF files.
// Headers.
#include <stdio.h>
#include <ctype.h>
#ifndef MAC_PLATFORM
#include <direct.h>
#include "PIHeaders.h"
#endif
// Defines ----------
// Define this flag to show AVConversionToPDFEnumHandler info. in log file.
#define SHOW_TOPDF_HANDLER_TYPES
// define this flag to use file type filter
#define USE_FILE_FILTER
Constants/Declarations
// Message display control. Ture: display
ASBool bEcho = true;
// File location. User can change the following filenames.
#if WIN_PLATFORM
const char* STRING_PDFBinderFolder = "C:\\Fairfax\\Adobe\\in";
const char* STRING_PDFOutputFolder = "C:\\Fairfax\\Adobe\\PDFA";
const char* FOLDERSYMBOL="\\";
#endif
#if MAC_PLATFORM
const char* STRING_PDFBinderFolder = "/PDFBinder";
const char* FOLDERSYMBOL="/";
#endif
char* OutputPdfFileName = "PDFBinderOutput.pdf";
char* LogFileName = "PDFProcessLog.txt";
static ASInt32 gNumToPDFExt;
static ASInt32 gNumFromPDFExt;
static AVConversionFromPDFHandler RightHandler;
const int MAX_FILENAME_LENGTH = 256;
char sLogFileName[MAX_FILENAME_LENGTH];
// Filter -----------
// Filter is a list of file types which can be converted to PDF in this program.
// Use a filter may fit user's specific needs and ensure a smooth automation process.
// Of course, the user can turn off the filter in two ways:
// (1) gPDFBinderFileFilter = "";
// (2) comment out //USE_FILE_FILTER
// The filter should be consistent with the Acrobat viewer's menu capability:
// Create PDF from multiple files ...
// Here we put the types which have been tested, but user can expand it.
const char* gPDFBinderFileFilter = "pdf,tif,tiff,PDF,TIF,TIFF";
const int MAX_STRING_LENGTH = 2048;
AVConversionToPDFHandler gHandler;
// functions in this file.
int ConvertAndInsertFileToPDF(ASPathName aspItem, char* aFileName, PDDoc PDFfile);
void BindingFileToPDF(ASPathName aPathName, char* aFilename, ASFileSysItemPropsRec nFileAttrb, PDDoc targetPDdDoc, ASPathName outputPathName, int *ipTotal, int *ipConverted);
ASBool PassPDFBinderFileFilter(char* filename);
int ConvertAndSavePDFInTargetFolder(ASPathName aPathName, char* aFileName, PDDoc PDFfile, ASPathName outputPathName);
char* NewFileName(char *& aFileName);
// callbacks
ACCB1 ASBool ACCB2 MyAVConversionToPDFEnumProc(AVConversionToPDFHandler handler, AVConversionEnumProcData data);
ACCB1 ASBool ACCB2 AVConversionToPDFEnumFindHandler(AVConversionToPDFHandler handler, AVConversionEnumProcData data);
static ACCB1 ASBool ACCB2 myAVConversionFromPDFEnumProc(AVConversionFromPDFHandler handler, AVConversionEnumProcData data);
Implementation
/** This sample implements a method to convert multiple files into PDF
and bind the PDFs into one PDF file .
This sample shows developers how to grammatically implement To-PDF file
converson functionality. Basically, the code uses AVConversionToPDFHandler
to convert files to PDF and PDDocInsertPages()to combine PDF files.
This plug-in is designed to run from a menu item, and by setting bEcho = false
it may be run without any graphics user interface on the screen. Therefore, it
can be executed from other programs such as C IAC, VB IAC, and JavaScript
to meet enterprise workflow needs.
How to run it :
- This sample adds a menu item "PDF Binder" under the Acrobat SDK submenu. Two ways to
execute it: 1) click the menu item to run the program using a fixed file location
hard coded; 2) press the shift key and click the menu item to choose a folder where
files to be converted are located.
- Without folder selection, this original code is to convert and bind files in a
directory C\test\PDFBinder for Win, or a folder MacHD:test:PDFBinder for Mac.
You can copy the test files in the project's testfiles folder to the appropriate location
for testing. You may locate files to be converted in another directory/folder, and
specify the location in the string variable PDFBinderFolder in the code.
- When you have the files to be converted ready in the specified location,
run Acrobat 6 menu Advanced->AcrobatSDK->PDF Binder to start the operation. There are
echo messages informing you of the operation start and end, but you can change and
rebuild the code to turn off the display on screen.
- An output file PDFBinderOutput.pdf in the same location is created
when the program succeeds. A text log file PDFBinderLog.txt in the same
location records the process and results.
- You can set bEch = false in the code to turn off any display on the screen.
This is necessary when you call the menu function from within other programs
of C IAC, VB IAC, JavaScript.
- An optional file filter is used to pre-process the files. The filter only allows
the files with predefined types to be processed. You can change the file type list
as you wish. Using a filter may ensure a smooth automation process, since you can put
only well-tested file types in the filter. To turn off the filter, you can set
gPDFBinderFileFilter = "" or not to define USE_FILE_FILTER
- Note this is a sample only, developers need to make further improvement for
their actual use. For example, you can set up a list of files to use the method for
the conversion and binding. And you can add code to handle special file types.
@see AVConversionConvertToPDFWithHandler
@see AVConversionEnumToPDFConverters
@see ASFileSysDestroyFolderIterator
@see PDDocOpen
@see PDDocClose
@see PDDocInsertPages
@see PDDocCreatePage
@see PDDocDeletePages
@see PDPageRelease
@see ASFileSysCreatePathName
@see ASFileSysFirstFolderItem
@see ASFileSysNextFolderItem
@see ASFileSysGetNameFromPath
@see ASFileSysReleasePath
ACCB1 void ACCB2 PDFBinderCommand(void*)
// if the menu item clicked with Shift key pressed down, go to interactive mode.
// let the user to choose a folder and process all the file in the folder.
ASText dispText = ASTextNew();
char PDFBinderFolder[MAX_STRING_LENGTH];
ASBool shiftKeyIsDown = ((AVSysGetModifiers() & AV_SHIFT) != 0);
if(shiftKeyIsDown) {
AVOpenSaveDialogParamsRec dialogParams;
// Configure the dialog box parameters.
memset (&dialogParams, 0, sizeof (AVOpenSaveDialogParamsRec));
dialogParams.size = sizeof(AVOpenSaveDialogParamsRec);
dialogParams.windowTitle = ASTextFromScriptText("Choose folder with files to bind",kASRomanScript);
dialogParams.flags |= kAVOpenSaveAllowForeignFileSystems;
dialogParams.initialFileSys = ASGetDefaultUnicodeFileSys();
ASPathName thePath;
ASFileSys fileSys;
AVAppBeginModal(NULL);
if(ASBoolToBool(AVAppChooseFolderDialog(&dialogParams, &fileSys, &thePath)) != true){
AVAppEndModal();
//AVAlertNote("Failed to select the folder");
return;
AVAppEndModal();
#ifdef WIN_PLATFORM
ASFileSysDisplayASTextFromPath(ASGetDefaultUnicodeFileSys(), thePath, dispText);
ASHostEncoding bestEnc = ASTextGetBestEncoding(dispText, (ASHostEncoding)PDGetHostEncoding());
strncpy(PDFBinderFolder, ASTextGetEncoded(dispText, bestEnc), MAX_STRING_LENGTH - 1);
#else
ASPlatformPath aspPath;
ASFileSysAcquirePlatformPath(fileSys, thePath, ASAtomFromString("POSIXPath"), &aspPath);
strncpy(PDFBinderFolder, (char *)ASPlatformPathGetPOSIXPathPtr(aspPath), MAX_STRING_LENGTH - 1);
ASFileSysReleasePlatformPath(fileSys, aspPath);
// remove extra path separator
char e = PDFBinderFolder[strlen(PDFBinderFolder)-1];
if(e == ':' || e == '/')
PDFBinderFolder[strlen(PDFBinderFolder)-1]='\0';
dispText = ASTextFromScriptText(PDFBinderFolder, kASEUnicodeScript);
#endif
ASFileSysReleasePath(fileSys, thePath);
// Otherwise, the hard coded file path will be used.
else {
strcpy(PDFBinderFolder, STRING_PDFBinderFolder);
dispText = ASTextFromScriptText(PDFBinderFolder, kASRomanScript);
// instruction message
char strMsg[MAX_STRING_LENGTH] = "";
sprintf(strMsg, "This function will convert and process Tiff and PDF files in the selected directory. ");
strcat(strMsg, " You need to copy your files in C:\\Fairfax\\Adobe\\in directory." );
strcat(strMsg, " Files will be processed into C:\\Fairfax\\Adobe\\PDFA directory." );
strcat(strMsg, " If you are ready, click OK to continue, or click Cancel to quit. " );
strcat(strMsg, " \nNote you can press down Shift key and click the menu item to have a folder selection. " );
strcat(strMsg, " \nNote you can turn off the echo message by setting bEcho = false and rebuild the code. " );
if(ASBoolToBool(bEcho)==true){
ASInt32 choice = AVAlert(ALERT_CAUTION, strMsg, "OK", "Cancel", NULL, true);
if(choice==2) {
return;
// create a new target pdf file with one empty page
PDDoc TargetPDF = PDDocCreate();
ASFixedRect mediaBox = { fixedZero, ASInt32ToFixed(792), ASInt32ToFixed(612), fixedZero };
PDPage emptyPage = PDDocCreatePage (TargetPDF, PDBeforeFirstPage, mediaBox);
PDPageRelease (emptyPage);
// get available headlers and set our file filter
char ValidExt[MAX_STRING_LENGTH];
memset(ValidExt, 0, MAX_STRING_LENGTH);
#ifdef SHOW_TOPDF_HANDLER_TYPES
// enumerate AVConversioToPDF handlers to get all available file
// types which can be converted to PDF.
AVConversionEnumToPDFConverters(MyAVConversionToPDFEnumProc, (AVConversionEnumProcData) ValidExt);
//AVAlertNote("Converters Defined");
//AVAlertNote(ValidExt);
//AVAlertNote(gPDFBinderFileFilter);
#endif
#ifdef USE_FILE_FILTER
// set File filter
strcpy(ValidExt, gPDFBinderFileFilter);
//AVAlertNote(ValidExt);
#endif
// process all files in the directory
int iNumFiles = 0;
int iNumFilesConverted = 0;
char* Done = "Converted";
char* NotDone = " - ";
char fileName[MAX_FILENAME_LENGTH+1];
ASFileSysItemPropsRec props;
ASFolderIterator iter;
ASPathName aspItem = NULL;
memset(&props, 0, sizeof(props));
props.size = sizeof(props);
//AVAlertNote("Props Defined");
ASPathName theFolder = NULL;
ASFileSys fileSys = NULL;
DURING
#ifdef WIN_PLATFORM
fileSys = ASGetDefaultFileSysForPath(ASAtomFromString("ASTextPath"), dispText);
theFolder = ASFileSysCreatePathName (fileSys, ASAtomFromString("ASTextPath"), dispText, 0);
//AVAlertNote("FileSys and Folder Defined");
#else
fileSys = ASGetDefaultFileSysForPath(ASAtomFromString("POSIXPath"), PDFBinderFolder);
theFolder = ASFileSysCreatePathName (fileSys,
ASAtomFromString("POSIXPath"), PDFBinderFolder, 0);
#endif
if (theFolder==NULL) {
//AVAlertNote("Fail to create ASPathName for the selected folder.");
E_RTRN_VOID
// Find first file in current directory
if((iter = ASFileSysFirstFolderItem(fileSys, theFolder, &props, &aspItem))==FALSE) {
//AVAlertNote("This is either an invalid folder or the folder contains no files.");
E_RTRN_VOID
ASFileSysReleasePath(fileSys, theFolder);
//AVAlertNote("Folder Released");
// get filename only
if(ASFileSysGetNameFromPath(fileSys, aspItem, fileName, sizeof(fileName))) {
E_RTRN_VOID
HANDLER
// exception handling
char errorMsg[256];
ASGetErrorString (ASGetExceptionErrorCode(), errorMsg, 256);
if(aspItem!=NULL) ASFileSysReleasePath(fileSys, aspItem);
if(theFolder!=NULL) ASFileSysReleasePath(fileSys, theFolder);
// display an error message.
if(ASBoolToBool(bEcho)==true) {
AVAlertNote (errorMsg);
return;
END_HANDLER
//AVAlertNote(fileName);
// go to binding if it's a valid type of file
if(props.type == kASFileSysFile && PassPDFBinderFileFilter(fileName)) {
char outFileName[] = "";
//strcat(outFileName, STRING_PDFOutputFolder);
//strcat(outFileName, FOLDERSYMBOL);
//strcat(outFileName, fileName);
strcat(outFileName, STRING_PDFOutputFolder);
strcat(outFileName, FOLDERSYMBOL);
strcat(outFileName, fileName);
//AVAlertNote(outFileName);
ASPathName outputFileName = ASFileSysCreatePathName (ASGetDefaultFileSys(), ASAtomFromString("Cstring"), outFileName, 0);
BindingFileToPDF(aspItem, fileName, props, TargetPDF, outputFileName ,&iNumFiles, &iNumFilesConverted);
//AVAlertNote("File Processed");
ASFileSysReleasePath(fileSys, aspItem);
// process all other files
while(ASFileSysNextFolderItem(fileSys, iter, &props, &aspItem)) {
// get filename only
if(ASFileSysGetNameFromPath(fileSys, aspItem, fileName, sizeof(fileName))) {
return;
// go to binding if it's a valid type of file
if(props.type == kASFileSysFile && PassPDFBinderFileFilter(fileName)) {
char outFileName[] = "";
//strcat(outFileName, STRING_PDFOutputFolder);
//strcat(outFileName, FOLDERSYMBOL);
//strcat(outFileName, fileName);
strcat(outFileName, STRING_PDFOutputFolder);
strcat(outFileName, FOLDERSYMBOL);
strcat(outFileName, fileName);
//AVAlertNote(outFileName);
ASPathName outputFileName = ASFileSysCreatePathName (ASGetDefaultFileSys(), ASAtomFromString("Cstring"), outFileName, 0);
BindingFileToPDF(aspItem, fileName, props, TargetPDF, outputFileName, &iNumFiles, &iNumFilesConverted);
//AVAlertNote("File Processed");
ASFileSysReleasePath(fileSys, aspItem);
ASPathName pdfPathName = NULL;
DURING
// close the findfile
ASFileSysDestroyFolderIterator(fileSys, iter);
// save and close the output pdf file
// create path
ASText pathText = ASTextNew();
ASTextCatMany(
pathText,
dispText,
ASTextFromScriptText(FOLDERSYMBOL, kASRomanScript),
ASTextFromScriptText(OutputPdfFileName, kASRomanScript),
NULL);
#ifdef WIN_PLATFORM
ASFileSys fileSys = ASGetDefaultFileSysForPath(ASAtomFromString("ASTextPath"), pathText);
pdfPathName = ASFileSysCreatePathName (fileSys,
ASAtomFromString("ASTextPath"), pathText, 0);
#else
char path[MAX_STRING_LENGTH];
strncpy(path, ASTextGetEncoded(pathText,
ASTextGetBestEncoding(pathText, (ASHostEncoding)PDGetHostEncoding())), MAX_STRING_LENGTH - 1);
ASFileSys fileSys = ASGetDefaultFileSysForPath(ASAtomFromString("POSIXPath"), path);
pdfPathName = ASFileSysCreatePathName (fileSys,
ASAtomFromString("POSIXPath"), path, 0);
#endif
if(pdfPathName==NULL) {
E_RTRN_VOID
// delete the empty page
if(PDDocGetNumPages(TargetPDF)>1) {
PDDocDeletePages (TargetPDF, 0,0,NULL, NULL);
// save
//PDDocSave (TargetPDF, PDSaveFull | PDSaveCollectGarbage | PDSaveLinearized,
// pdfPathName, ASGetDefaultUnicodeFileSys(), NULL, NULL);
PDDocClose (TargetPDF);
//ASFileSysReleasePath(fileSys, pdfPathName);
HANDLER
// exception handling
char errorMsg[256];
ASGetErrorString (ASGetExceptionErrorCode(), errorMsg, 256);
if(pdfPathName!=NULL) ASFileSysReleasePath(fileSys, pdfPathName);
// display an error message.
if(ASBoolToBool(bEcho)==true) {
AVAlertNote (errorMsg);
return;
END_HANDLER
// use this line to show the massage on screen if you need
//if(ASBoolToBool(bEcho)==true) {
AVAlertNote ("Folder Completed. PDF/A Output files generated.");
return;
/* ConvertAndInsertFileToPDF
/** Internal function \n
** Convert a file to PDF, then insert it to target PDF file.
** @param aFileName IN char string, filename.
** @param PDFfile IN/OUT PDDoc of the target PDF file.
** @return 0 if OK, 1 if failed.
int ConvertAndInsertFileToPDF(ASPathName aPathName, char* aFileName, PDDoc PDFfile)
PDDoc tempPDF;
char* Ext;
DURING
// get file extention
Ext = strrchr(aFileName,'.');
if(Ext) {
Ext++;
else {
E_RETURN (1);
// if the file is PDF, open PDDoc
if(strcmp(Ext,"PDF")==0 || strcmp(Ext,"pdf")==0) {
tempPDF = PDDocOpen (aPathName, ASGetDefaultFileSys(), NULL, true);
if(tempPDF==NULL) {
PDDocClose(tempPDF);
E_RETURN (1);
// else convert it to PDF
else
// let it automatically find right handler for the file and do the job.
AVConversionStatus stat = AVConversionConvertToPDF
(kAVConversionAsyncOkay, //kAVConversionNoFlags
aPathName, ASGetDefaultFileSys(), &tempPDF, NULL);
// check if successful
if(stat != kAVConversionSuccess) {
//AVAlertNote("Cannot convert the file.");
E_RETURN (1);
HANDLER
// exception handling
char errorMsg[256];
ASGetErrorString (ASGetExceptionErrorCode(), errorMsg, 256);
// display an error message.
if(ASBoolToBool(bEcho) == true) {
AVAlertNote (errorMsg);
return 1;
END_HANDLER
// insert new PDF into target PDF
DURING
// insert all pages of new pdfc to TargetPDFfile.
PDDocInsertPages(PDFfile, PDLastPage, tempPDF, 0,
PDAllPages, PDInsertAll, NULL, NULL, NULL, NULL);
PDDocClose(tempPDF);
HANDLER
char errorMsg[256];
ASGetErrorString (ASGetExceptionErrorCode(), errorMsg, 256);
if(ASBoolToBool(bEcho)==true) {
AVAlertNote(errorMsg);
END_HANDLER
if(strcmp(Ext,"doc")==0) {
char fname[40];
sprintf(fname,"%s.pdf",aFileName);
remove(fname);
return 0;
/* MyAVConversionToPDFEnumProc
/** Internal callback function \n
** called for every AVConversionToPDFHandler.
** get the valid type (file extention) for the conversion.
** @return true.
ACCB1 ASBool ACCB2 MyAVConversionToPDFEnumProc(AVConversionToPDFHandler handler,
AVConversionEnumProcData data)
ASUns16 numFileExt = handler->convFilter.numFileDescs;
for (int i = 0; i < numFileExt; i++) {
char* ext = handler->convFilter.fileDescs[i].extension;
if(strlen(ext)>0) {
strcat((char*) data, ext);
strcat((char*) data, ",");
return true;
/* this is alternative code to get right conversion handler for a specific file
to be converted. It works with function AVConversionConvertToPDFWithHandler.
It's not used now, but kept for user's reference.
ACCB1 ASBool ACCB2 AVConversionToPDFEnumFindHandler(AVConversionToPDFHandler handler,
AVConversionEnumProcData data)
ASUns16 numFileExt = handler->convFilter.numFileDescs;
for ( int i = 0; i < numFileExt; i++)
char* ext = handler->convFilter.fileDescs[i].extension;
if(strlen(ext)) {
if(!strcmp((char*) data, ext)) {
gHandler = handler;
return false;
return true;
/* BindingFileToPDF
/** Internal callback function for binding process \n
** IN: char* aFilename, ASFileSysItemPropsRec nFileAttrb \n
** PDDoc targetPDdDoc, int *ipTotal, \n
** int *ipConverted, FILE *logfile \n
** OUT: int *ipTotal, int *ipConverted. \n
void BindingFileToPDF(ASPathName aPathName, char* aFilename, ASFileSysItemPropsRec nFileAttrb, PDDoc targetPDdDoc, ASPathName outputPathName, int *ipTotal, int *ipConverted)
// ignore system, hidden files, and our target PDF and log file.
if( nFileAttrb.isHidden
|| (strcmp(aFilename,".")==0) || (strcmp(aFilename,".." )==0)
|| (strcmp(aFilename,OutputPdfFileName)==0) || (strcmp(aFilename,LogFileName)==0)) {
return;
(*ipTotal)++;
char msg[MAX_STRING_LENGTH] = "";
char* Done = "Converted";
char* NotDone = " - ";
// try to convert and insert it to target PDF file.
// rc would be 0 for success, otherwise 1.
int rc = ConvertAndSavePDFInTargetFolder(aPathName, aFilename, targetPDdDoc, outputPathName);
// if converted
if(rc==0) {
(*ipConverted)++;
/* PassPDFBinderFileFilter
/** Internal callback function for binding process
** @return true if the IN aFilename is a valid file for PDF conversion,
** otherwise false.
ASBool PassPDFBinderFileFilter(char* aFilename)
#ifdef USE_FILE_FILTER
// if the filter is empty, any file will pass.
if(strlen(gPDFBinderFileFilter)==0)
return true;
char* Ext = strrchr(aFilename,'.');
if(Ext!=NULL) {
Ext++;
if(strstr(gPDFBinderFileFilter, Ext)) {
return true;
return false;
#else
// not use filter, any file will pass.
return true;
#endif
/* ConvertAndInsertFileToPDF
/** Internal function \n
** Convert a file to PDF, then insert it to target PDF file.
** @param aFileName IN char string, filename.
** @param PDFfile IN/OUT PDDoc of the target PDF file.
** @return 0 if OK, 1 if failed.
int ConvertAndSavePDFInTargetFolder(ASPathName aPathName, char* aFileName, PDDoc PDFfile, ASPathName outputPathName)
PDDoc tempPDF;
char* Ext;
DURING
// get file extention
Ext = strrchr(aFileName,'.');
if(Ext) {
Ext++;
else {
E_RETURN (1);
// if the file is PDF, open PDDoc
if(strcmp(Ext,"PDF")==0 || strcmp(Ext,"pdf")==0) {
tempPDF = PDDocOpen (aPathName, ASGetDefaultFileSys(), NULL, true);
if(tempPDF==NULL) {
PDDocClose(tempPDF);
E_RETURN (1);
// else convert it to PDF
else
// let it automatically find right handler for the file and do the job.
AVConversionStatus stat = AVConversionConvertToPDF
(kAVConversionAsyncOkay, //kAVConversionNoFlags
aPathName, ASGetDefaultFileSys(), &tempPDF, NULL);
// check if successful
if(stat != kAVConversionSuccess) {
//AVAlertNote("Cannot convert the file.");
E_RETURN (1);
else {
//change Extension
ASText asTmp = ASTextNew();
ASFileSysDisplayASTextFromPath(ASGetDefaultUnicodeFileSys(), outputPathName, asTmp);
//AVAlertNote(ASTextGetScriptText(asTmp, kASRomanScript));
if(strcmp(Ext,"TIF")==0 || strcmp(Ext,"tif")==0){
ASTextReplace(asTmp, ASTextFromScriptText(".tif", kASRomanScript), ASTextFromScriptText(".pdf", kASRomanScript));
} else {
ASTextReplace(asTmp, ASTextFromScriptText(".tiff", kASRomanScript), ASTextFromScriptText(".pdf", kASRomanScript));
//AVAlertNote(ASTextGetScriptText(asTmp, kASRomanScript));
outputPathName = ASFileSysCreatePathName (ASGetDefaultUnicodeFileSys(), ASAtomFromString("ASTextPath"), asTmp, 0);
HANDLER
// exception handling
char errorMsg[256];
ASGetErrorString (ASGetExceptionErrorCode(), errorMsg, 256);
// display an error message.
if(ASBoolToBool(bEcho) == true) {
AVAlertNote (errorMsg);
return 1;
END_HANDLER
// Run OCR and Save new PDF into target PDF
DURING
// OCR
ASAtom cmdName;
AVCommand cmd;
cmdName=ASAtomFromString("PaperCapture");
cmd=AVCommandNew(cmdName);
ASCab config = ASCabNew();
ASCabPutInt (config, "UIPolicy", kAVCommandUISilent); //hide the interface
if (kAVCommandReady == AVCommandSetConfig (cmd, config)) {
//AVAlertNote("Config Ready");
ASCab inputs = ASCabNew();
ASCabPutPointer (inputs, kAVCommandKeyPDDoc, PDDoc, tempPDF, NULL);
if (kAVCommandReady == AVCommandSetInputs (cmd, inputs)) {
//AVAlertNote("Input Ready");
ASCabDestroy (inputs);
AVCommandStatus status = AVCommandExecute(cmd);
//switch (status) {
// case kAVCommandReady :
// AVAlertNote("Not working, but ready to work.");
// break;
// case kAVCommandWorking :
// AVAlertNote("Still working");
// break;
// case kAVCommandDone :
// AVAlertNote("Done working");
// break;
// case kAVCommandInError :
// AVAlertNote("In Error");
// break;
// case kAVCommandNotExecuted :
// AVAlertNote("Command not executed due to lack of objects on which the command to be executed");
// break;
AVCommandDestroy(cmd);
//Save
//PDDocSave (tempPDF, PDSaveFull | PDSaveCollectGarbage | PDSaveLinearized, outputPathName, ASGetDefaultUnicodeFileSys(), NULL, NULL);
//ClosePDF
//PDDocClose(tempPDF);
//Convert to PDF/A Compliance
//Select the right handler
AVConversionEnumFromPDFConverters(myAVConversionFromPDFEnumProc, NULL);
// do conversion
AVConversionStatus stat = AVConversionConvertFromPDFWithHandler(RightHandler, NULL, kAVConversionAsyncOkay, tempPDF, outputPathName, ASGetDefaultFileSys(), NULL);
// check the returned status and show message
//if (stat == kAVConversionSuccess)
// AVAlertNote( "The PDF/A file was saved in output folder." );
//else if (stat == kAVConversionFailed)
// AVAlertNote( "The PDF/A conversion failed." );
//else if (stat == kAVConversionSuccessAsync)
// AVAlertNote( "The conversion will continue asynchronously." );
//else if (stat == kAVConversionCancelled)
// AVAlertNote( "The conversion was cancelled." );
//Save
//PDDocSave (tempPDF, PDSaveFull | PDSaveCollectGarbage | PDSaveLinearized, outputPathName, ASGetDefaultUnicodeFileSys(), NULL, NULL);
//ClosePDF
PDDocClose(tempPDF);
ASFileSysReleasePath(ASGetDefaultFileSys(), outputPathName);
HANDLER
char errorMsg[256];
ASGetErrorString (ASGetExceptionErrorCode(), errorMsg, 256);
if(ASBoolToBool(bEcho)==true) {
AVAlertNote(errorMsg);
END_HANDLER
if(strcmp(Ext,"doc")==0) {
char fname[40];
sprintf(fname,"%s.pdf",aFileName);
remove(fname);
return 0;
//Select the appropiate handler for the PDF/A conversion
static ACCB1 ASBool ACCB2 myAVConversionFromPDFEnumProc(AVConversionFromPDFHandler handler, AVConversionEnumProcData data)
AVFileFilterRec filter = handler->convFilter;
ASUns16 numFileExt = filter.numFileDescs;
char *kUniqueID = handler->uniqueID;
// go through the conversion handlers to find a handler for PDF extension files and the unique key matches the PDF/A one.
for (ASInt32 i = 0; i < numFileExt; i++)
if (strlen(handler->convFilter.fileDescs[i].extension)>0)
// found it, fill in the handler and return false to stop going on.
if (!strcmp(handler->convFilter.fileDescs[i].extension, "pdf") && !strcmp(kUniqueID,"com.callas.preflight.pdfa")) {
RightHandler = handler;
return false ;
return true;There are some options for various APIs to run "kinda silent" - but again, Acrobat is designed for INTERACTIVE use…so "completely silent" isn't really an option.
As for speed – you'd need to be MUCH MORE specific about where your slow downs are. Have you profiled?
From: Adobe Forums <[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
Date: Mon, 12 Dec 2011 07:39:08 -0800
To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
Subject: Slow processing and getting opening errors/warnings
Re: Slow processing and getting opening errors/warnings
created by FFX-ER<http://forums.adobe.com/people/FFX-ER> in Acrobat SDK - View the full discussion<http://forums.adobe.com/message/4079175#4079175 -
Unicode (non-English) Classpath problem!
Hi All,
On WinXP I created a folder which name was in Japaness.
When I run my applet from this folder
the JRE (version 1.5) couldn't load the class from this folder,
see the error message below:
liveconnect: Invoking JS method: document
liveconnect: Invoking JS method: URL
basic: Referencing classloader: sun.plugin.ClassLoaderInfo@85af80, refcount=1
basic: Added progress listener: sun.plugin.util.GrayBoxPainter@1a0c10f
basic: Loading applet ...
basic: Initializing applet ...
basic: Starting applet ...
load: class MyClass.class not found.
java.lang.ClassNotFoundException: MyClass.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
Caused by: java.io.FileNotFoundException: D:\Server\parent\??????\MyClass\class.class (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
..........It seems that it converted my japaness directory in name to ...\???????\... when loading.
Is the JRE 1.5 supports the unicode for file/directory naming,
if yes does it support the class/resource loading from those unicode directories?
Please help to load class from an unicode directory in name.
Many Thanks!I know only of a bug, where the jar file is not allowed to be unicode.
However, might it be that a ".class" should be removed?
Reread the error message. -
Error - Intialising Routing Engine
I ve installed Oracle 10g spatial and now trying to istall the routing engine. Do u know what this Oracle Spatial Geocoder is ?? How can I check it is installed.
I did the following steops to install the routing engine
Made changes to the http-web-site.xml, server.xml file of OC4J.
Started OC4J with the following command
Java âserver... . ..
When opening the routeserver in the browser, index page of routeserver is opening with welcome note Routeserver Successfully Deployed.
But not able to make proper changes to the file /routeserver/web/WEB-INF/web.xml for successful initialization of routeserver
Importing sample Datafile
Error coming while running the following command to import tablespace
C:\pinellas-county>impdp adci DIRECTORY=adci_dump_dir DUMPFILE=tts.dmp TRANSPORT DATAFILES='C:\pinellas-county\adcidata.ora'
Import: Release 10.1.0.2.0 - Production on Tuesday, 07 June, 2005 10:59
Copyright (c) 2003, Oracle. All rights reserved.
Password:
Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
tion
With the Partitioning, OLAP and Data Mining options
Master table "ADCI"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
Starting "ADCI"."SYS_IMPORT_TRANSPORTABLE_01": adci/******** DIRECTORY=adci/********dumpdir DUMPFILE=tts.dmp TRANSPORT_DATAFILES='C:\pinellas-county\adci/********_data.ora'
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
ORA-39123: Data Pump transportable tablespace job aborted
ORA-06550: line 2, column 2:
PLS-00306: wrong number or types of arguments in call to 'BEGINIMPORT'
ORA-06550: line 2, column 2:
PL/SQL: Statement ignored
Job "ADCI"."SYS_IMPORT_TRANSPORTABLE_01" stopped due to fatal error at 10:59
thnx
deepthyHi,
You can download from metalink. You will need a metalink account to do this.
I've just downloaded the sample data from adci.
It did install for me.
Can you post the exact steps you ran through?
Also, what hardware platform are you running on?
Thanks,
Dan
Here are the exact steps I ran through:
sqlplus system/pass*****
CREATE USER ADCI PROFILE "DEFAULT"
IDENTIFIED BY "ADCI" DEFAULT TABLESPACE "USERS"
TEMPORARY TABLESPACE "TEMP" ACCOUNT UNLOCK;
GRANT "CONNECT" TO "ADCI";
GRANT imp_full_database, create table, create sequence TO ADCI;
CREATE or replace DIRECTORY adci_dump_dir AS 'C:\oracle\oradata\ora10g';
GRANT READ, WRITE ON DIRECTORY adci_dump_dir TO adci;
ALTER USER adci QUOTA UNLIMITED ON USERS;
exit;
---Since I am running on windows I do not need to use RMAN convert
impdp adci DIRECTORY=adci_dump_dir DUMPFILE=tts.dmp TRANSPORT_DATAFILES='C:\oracle\oradata\ora10g\adci_data.ora'
-- GOT OUTPUT LIKE THIS:
--Import: Release 10.1.0.4.0 - Production on Wednesday, 15 June, 2005 14:13
--Copyright (c) 2003, Oracle. All rights reserved.
--Password:
--Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - Production
--With the Partitioning, OLAP and Data Mining options
--Master table "ADCI"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
--Starting "ADCI"."SYS_IMPORT_TRANSPORTABLE_01": adci/******** DIRECTORY=adci/***
--*****dumpdir DUMPFILE=tts.dmp TRANSPORT_DATAFILES='C:\oracle\oradata\ora10g\adci/********_data.ora'
--Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
--Processing object type TRANSPORTABLE_EXPORT/TYPE/TYPE_SPEC
--ORA-31684: Object type TYPE:"MDSYS"."SDO_ORDINATE_ARRAY" already exists
--ORA-39083: Object type TYPE failed to create with error:
--ORA-02311: cannot alter with COMPILE option a valid type with type or table dependents
--Failing sql is:
----ERRORS LIKE THE ABOVE CAN BE IGNORED
sqlplus system/pass*****
ALTER TABLESPACE ADCI_DATA READ WRITE;
ALTER USER ADCI QUOTA UNLIMITED ON ADCI_DATA;
connect adci/adci
EXEC SDO_UTIL.INITIALIZE_INDEXES_FOR_TTS
INSERT INTO USER_SDO_MAPS SELECT * FROM SDO_MAPS;
INSERT INTO USER_SDO_THEMES SELECT * FROM SDO_THEMES;
INSERT INTO USER_SDO_STYLES SELECT * FROM SDO_STYLES;
COMMIT;
exec dbms_stats.gather_schema_stats(ownname=>'ADCI',cascade=>TRUE,estimate_percent=>15);
select SDO_gcdr.geocode('ADCI',
SDO_keywordArray( '13359 Seminole Blvd','Largo, FL 33778'), 'US', 'DEFAULT')
from dual ;
SDO_GCDR.GEOCODE('ADCI',SDO_KEYWORDARRAY('13359SEMINOLEBLVD','LARGO,FL33778'),'U
SDO_GEO_ADDR(0, SDO_KEYWORDARRAY(), NULL, 'SEMINOLE BLVD', NULL, NULL, 'LARGO',
NULL, 'FL', 'US', '33778', NULL, '33778', NULL, '13359', 'SEMINOLE', 'BLVD', 'F'
, 'F', NULL, NULL, 'R', .8975, 22864031, '????#ENUT?B281CP?', 1, 'DEFAULT',
-82.78702, 27.8941784) -
After LDAP failure rebuild I cannot turn on Wiki for group
Our LDAP database died today so I converted the Open Directory Master to Standalone then back to an Open Directory Master and rebuilt our users and groups. No settings were changed in the Web section of the server. But now I cannot choose anything from WorkGroup Manager -> (Group) -> Basic -> Enable the following services for this group on: It only offers me "(None)" and not our site.
I removed the site from the Web settings and made a new one, still the same behavior.
I feel like I'm missing something obvious, can anyone point me in the right direction?
OS X Server version 10.5.6Hi,
If you rebuilt the LDAP and ensured the UIDs are the same for groups as before, it seems rebuilding the connection with web service is not complete.
I have had to do the following after some upgrades:
If you have your groups listed in the website under Web Services /Services for Groups then remove them, restart web service (or teams), reinstall the groups in the Services for Groups and again restart web service. Then Enable the services for each group in WGM.
HTH,
Harry -
Batch Resize, ppi & save as PNG
Ok so I have been experimenting around with Photoshop cs6's Actions and creating my own, but I can't perfect them. I have a little file structure where I store textures and there are many sub folders and all my images are .JPEG.
My question is:
How do I create an action that will:
Change all my JPEG images to PNG
Resize all pictures to 2048x2048
set ppi to 72
and
Retain file name and location within the folder structure.
Thanks for any help!I prefer to do this type of batch processing work in IrfanView (faster, more consistent behaviour in my experience).
http://www.irfanview.com/
It's free, and very quick to convert images - much faster than Photoshop.
1) File-->Batch Conversion/Rename, and change option to either "batch conversion" or "batch conversion - rename result files" (select the last option if you need the files to be automatically renamed)
2) change output format to PNG (adjust option to your liking)
3) check "Use advanced options"
4) click the advanced button, and set one or both sides to 2048. Check resample function for better quality.
5) set the new DPI value to 72 (bottom left).
6) in the Misc section, check "create subfolders in destination folder".
7) click OK
8) you can change the name pattern, if you like. Depends on the first step.
9) browse to the texture folder. Check "Include subdirectories" in the left column.
10) navigate to the specific folder that contains all the subfolders. Click "Add All".
11) change the output directory.
12) Start the batch (click "start batch" button.
All images are converted, and the directory structure is retained. You may have to browse in the folder structure until you are on the level you require. -
Problem with Adobe convertor printer driver
I'm having 2 separate issue with the Adobe converter printer driver.
I'm trying to convert a chm file to PDF file with mixed results.
1. after the file is converted, it doesn't do a complete job of it. it produces a pdf file with 68 pages, there was quite a few more pages it didn't include.
2.the driver no longer works. I make the selection to convert to a directory, after conversion, I find that the directory is empty.that was supposed to be "I make the selection to convert the file to a directory"
the converted file was supposed to appear in a directory.
select adobe pdf converter
select print
save pdf file as window appear
directory is selected
select save -
Migration forms 4.5 to 6.0
We have an application runing in character mode, we going to migrate FORMS from 4.5 to 6.0. I want to know if someone had any kind of troubles in this migration and how solved that trouble.
I did this converting, in '99 year, long time ago
I recommended you the Developer version 1.5 or 2.1, for this convertion. in the directory BIN exists a file named f60cmp32.exe (or f60comp32.exe some like this...if not exists try f60run32.exe)
this program show you a window of parameters of compilation where put the name of .inp and the name of new file (.fmx), userid & pass, type (forms), the access (in database or .inp) and ready...
all the code translate good, only modify the canvases defaut.
I wish the best
Maybe you are looking for
-
HT3775 What software do I need to upload videos from my camcorder onto my Mac Pro?
I put the card in from my camcorder and it said that I needed some applicatio?
-
Display - Color Labels Messed Up
Display suddenly switched from normal to all colors being wrong. Color labels show up incorrectly, but I cannot figure out how to correct them.
-
All pictures not backed up from iTunes
I lost my iPhone 5s on holiday a couple of weeks ago and I have received a new phone (iPhone 5s) today. I thought I had lost all my photos and apps and I received them all when I did a backup. I believe this happened because I synced the phone with i
-
Colour Management Problem - Please Help!
I am using Photoshop CS3 I have edited a portrait image in Camera Raw. From Bridge I have used Tools -> Photoshop -> Web Photo Gallery I have taken one of the resulting JPEGS out and it displays absolutely fine in Microsoft applications, and skin ton
-
I have CS6 standard for Mac. Can I install it on a PC?
I have CS6 standard for Mac. Can I install it on a PC? I am forced to upgrade to a new PC, IT will no longer support the lone Mac in the office.