我一直在阅读Apple的文档,他们建议使用UIWebView.这一切都很好,直到您想要转到页码并搜索PDF文件.
是否有任何第三方图书馆(免费或付费)可以执行此操作?
至少我需要能够搜索并转到PDF中的页码.
我看了,PDFKit不可用,Quartz方法似乎有限.由于应用商店中提供的PDF阅读器数量,这显然是可能的.
我一直在寻找我公司当前批处理系统(java SE + crontab)的替代品,因为有很多java代码/ shell脚本重复,大多数工作都是ETL并且做了非常相似的步骤而且我想提供平台独立而不是依赖于crontab,更具体的是我们的工作角色,当前的创造就业步骤是这样的:
大部分相同的逻辑被设计和开发成一个系统,其中包含通用例程,这些程序或"接口"(即他们在那里称之为)是独立完成的(通常使用复制粘贴代码,因为大多数例程都相似),但我我仍然缺少一个非常重要的部分,我需要帮助,这涉及我使用的调度程序实现,我需要它来满足这两个需求之一:
- 我想保证每当我停止调度服务器进行系统更新(由于添加了新的工作等)或其他原因时,那些由于系统停机而无法运行的作业(例如3个工作可以由于系统已关闭,因此无法在下午3:00运行,即使各自的调度时间已经消失,也可以在服务器恢复运行时运行.
或者,如果第一件事不可能,那么:
- 我需要一种方法来使用新作业更新调度程序,并且还需要更新提供这些作业的jar,而无需重新启动调度程序(类似于OSGi).
这些条件中的任何一个都满足我的要求,并且会结束我对替换的搜索,我查看了Quartz,Oddjob(这是一个使用这个调度程序生产的调度程序,但是每次添加新的作业/库时都需要重新启动,不满足我的需求)和OSGi使用应用服务器,但我正在寻找更好的建议,如果你也知道更好的选择,他们也非常感激.
我的代码如下.我得到的错误是
断言失败:(s-> stack-> next!= NULL),函数CGGStackRestore,文件Context/CGGStack.c,第116行.
码:
CGPDFPageRef page = CGPDFDocumentGetPage(document, i+1);
CGRect pageRect = CGPDFPageGetBoxRect(page, kCGPDFMediaBox);
CGFloat pdfScale = width/pageRect.size.width;
pageRect.size = CGSizeMake(pageRect.size.width*pdfScale, pageRect.size.height*pdfScale);
pageRect.origin = CGPointZero;
UIGraphicsBeginImageContext(pageRect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
// White BG CGContextSetRGBFillColor(context, 1.0,1.0,1.0,1.0); CGContextFillRect(context,pageRect); CGContextSaveGState(context);
CGContextTranslateCTM(context, 0.0, pageRect.size.height);
CGContextScaleCTM(context, 1.0, -1.0);
CGContextConcatCTM(context, CGPDFPageGetDrawingTransform(page, kCGPDFMediaBox, pageRect, 0, true));
CGContextDrawPDFPage(context, page);
CGContextRestoreGState(context);
UIImage *thm = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
NSLog(@"Image %@",thm);
pdfImage = [[UIImageView alloc] initWithImage:thm];
NSLog(@"Image View: %@",pdfImage);
[self.view addSubview:pdfImage];
[self.view reloadInputViews
];
Run Code Online (Sandbox Code Playgroud)
请帮忙.
我Complete在操作下拉列表中添加了自定义选项(sales-> orders).它工作正常,订单状态更改成功完成.
我正在整合所有订单Salesforce.我需要所有的订单详情orderid.项目详细信息和总计已成功获取.
任何人都可以帮助获取Customer名称和他/她的公司名称如何提交订单.以下是我获取订单详细信息的完整代码:
$order = Mage::getModel('sales/order')->load($orderId);
$items = $order->getAllItems();
$_totalData = $order->getData();
$_grand = $_totalData['grand_total'];
$custname = $_totalData->getCustomerName();
$itemcount=count($items);
foreach ($items as $itemId => $item)
{
$sObject2->Item_name__c = $item->getName();
$sObject2->Unit_price__c = $item->getPrice();
$sObject2->Sku__c = $item->getSku();
$sObject2->Quantity__c = $item->getQtyToInvoice();
}
Run Code Online (Sandbox Code Playgroud) 我们的solr索引会根据计划刷新,也可以根据需要通过DataImportHandler完全导入进行任意刷新.我们曾多次因各种原因导致进口失败.
如何在使用DataImportHandler执行导入时收到错误发生的通知(最好是电子邮件)?
我试图在另一个内部绘制两个圆圈,如下图所示.

我设法很好地绘制了一个圆圈(外部圆圈),但我不确定如何在顶部添加第二个圆圈,以及如何将其居中.
- (void)drawRect:(CGRect)rect {
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetLineWidth(context, 4.0);
CGContextSetStrokeColorWithColor(context,
[UIColor whiteColor].CGColor);
//
UIColor *theFillColor = UIColorFromRGB(0x6c83a6);
CGContextSetFillColor(context, CGColorGetComponents(theFillColor.CGColor));
CGRect rectangle = CGRectMake(5.0,5.0,rect.size.width-10.0,rect.size.height-10.0);
CGContextAddEllipseInRect(context, rectangle);
CGContextStrokePath(context);
CGContextFillEllipseInRect(context, rectangle);
UIGraphicsEndImageContext();
//
// INSIDE ?
//
}
Run Code Online (Sandbox Code Playgroud) 我使用石英、Spring 和 Hibernate 作为 JPA 提供程序。数据库是甲骨文。
我有一种方法可以将文件写入文件系统并使用详细信息更新数据库。可以通过两种方式调用此方法:
我已将石英设置为:
<bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean" lazy-init="false" scope="singleton">
<property name="autoStartup" value="true"/>
<property name="waitForJobsToCompleteOnShutdown" value="true"/>
<property name="overwriteExistingJobs" value="true"/>
<property name="dataSource" ref="dataSource"/>
<property name="transactionManager" ref="transactionManager"/>
<property name="quartzProperties">
<props>
<prop key="org.quartz.scheduler.instanceName">FileScheduler</prop>
<prop key="org.quartz.scheduler.instanceId">AUTO</prop>
<prop key="org.quartz.jobStore.misfireThreshold">6000</prop>
<prop key="org.quartz.jobStore.class">org.quartz.impl.jdbcjobstore.JobStoreTX</prop>
<prop key="org.quartz.jobStore.driverDelegateClass">${driverDelegateClass}</prop>
<prop key="org.quartz.jobStore.tablePrefix">QRTZ_</prop>
<prop key="org.quartz.jobStore.isClustered">true</prop>
<prop key="org.quartz.threadPool.class">org.quartz.simpl.SimpleThreadPool</prop>
<prop key="org.quartz.threadPool.threadCount">5</prop>
<prop key="org.quartz.threadPool.threadPriority">5</prop>
</props>
</property>
</bean>
Run Code Online (Sandbox Code Playgroud)
这种方法是使用 spring 管理的事务。
问题是当这个方法被石英调度器调用时,文件被创建但数据库没有更新(应该有两个表更新和一个表插入)。
我也启用了 hibernate show_SQL,但在调度程序的情况下,不会记录更新\插入语句。
尽管当 Web 服务请求调用此方法时,这可以正常工作。日志也显示更新\插入语句。
更新 1
总结我的问题,这就是我想要实现的目标:
最后,我希望所有表格都得到更新。 …
我正在使用石英调度程序来安排我的工作。我用过CronTrigger。但问题是触发器会被多次触发。这是我设置 cron 调度程序的代码..
SchedulerFactory schFactory = new StdSchedulerFactory();
Scheduler sched = null;
CronTrigger cronTrigger = null;
try {
sched = schFactory.getScheduler();
JobDetail jobDetail = new JobDetail("job1", "group1",SchedulerPBGC.class);
String cronTimerStr = "* 16 15 * * ? *";
LOG.warn("CRON TRIGGER FORMAT FOR PROCESSING PB GC DATA:"+cronTimerStr);
cronTrigger = new CronTrigger("SchedTrigger", "Group1", cronTimerStr);
sched.scheduleJob(jobDetail, cronTrigger);
sched.start();
LOG.warn("SCHEDULER REGISTERED FOR PROCESSING PB GC DATA : TIME :"+cronTimerStr);
} catch (SchedulerException se) {
LOG.error("SchedulerException Message::"+se.getLocalizedMessage());
}
Run Code Online (Sandbox Code Playgroud)
这里我的调度程序执行了作业 10 次...在这里你可以看到日志..
2012-06-20 15:16:50,001 DefaultQuartzScheduler_Worker-1 WARN test.SchedulerPBGC …Run Code Online (Sandbox Code Playgroud) 我在我的Web应用程序(Servlet Web应用程序)中使用了quartz,下面是quartz.property文件和quartz.job.xml的快照.
quartz.property
#===================================================
# Configure the Job Initialization Plugin
#===================================================
org.quartz.plugin.jobInitializer.class = org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin
org.quartz.plugin.jobInitializer.fileNames = jobs.xml
org.quartz.plugin.jobInitializer.failOnFileNotFound = true
org.quartz.plugin.jobInitializer.scanInterval = 10
org.quartz.plugin.jobInitializer.wrapInUserTransaction = false
<?xml version='1.0' encoding='utf-8'?>
<job-scheduling-data xmlns="http://www.quartz-scheduler.org/xml/JobSchedulingData"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.quartz-scheduler.org/xml/JobSchedulingData http://www.quartz-scheduler.org/xml/job_scheduling_data_1_8.xsd"
version="1.8">
<schedule>
<job>
<name>my-very-clever-job</name>
<group>MYJOB_GROUP</group>
<description>The job description</description>
<job-class>com.acme.scheduler.job.ReportJob</job-class>
</job>
<trigger>
<cron>
<name>my-trigger</name>
<group>MYTRIGGER_GROUP</group>
<job-name>my-very-clever-job</job-name>
<job-group>MYJOB_GROUP</job-group>
<!-- trigger every night at 4:30 am -->
<cron-expression>0 30 4 * * ?</cron-expression>
</cron>
</trigger>
</schedule>
</job-scheduling-data>
Run Code Online (Sandbox Code Playgroud)
按顺序,每件事都很好.我需要允许用户按照他们想要的方式更改时间(cron表达式).我的问题是如何动态设置cron表达式.